关于c#中第一个应用的一般问题 [英] general question about first app in c#

查看:53
本文介绍了关于c#中第一个应用的一般问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!我正在研究计算机工程,我开始编程。我必须用c#准备一个库存控制系统,使用二叉树来查看库存中的物品(在数据库中)。有人能帮助我吗?我需要一些说明,建议,手册,意见,事实上你能给我的一切都会很好。非常感谢你!

解决方案

First Solution

解决方案是在数据库端,您有一列产品ID作为主键,而另一列则根据需要。在编码方面,您需要一个函数来获取数据库上的所有productID,并将它们放在int或long的排序数组中,具体取决于产品的数量。从那里你可以简单地创建一个使用二进制搜索查看该数组的函数来检查产品是否存在。

二进制搜索算法



第二个解决方案

您可以创建包含ProductID及其他所需产品的对象类。您可以使用productID创建二叉树以对对象进行排序。要查找库存,您必须创建类似于二进制搜索算法的功能



编辑:您的表格可能如下:

PRODUCT_TABLE:PRODUCT_ID作为主键,GROUP_ID作为外键,PRODUCT_NAME,PRODUCT_PRICE

GROUP_TABLE:GROUP_ID作为主键,Group_Name



注意:你可能想要2个二叉树,一个用于产品,一个用于组。在Group类和Product类中需要相互引用的属性


由于你尚未使用C Sharp,我建议你先学习它。



MSDN是获取与该技术相关的所有资源的最佳位置。您还可以找到文章和示例代码。



当您开始学习C#时,您还将构建许多演示应用程序。这些演示将帮助您轻松理解这些概念。



如果您在编程时遇到任何困难,您可以随时在此处发布问题,指出确切的问题。你也可以在这里找到很多关于.NET的精彩文章。



最后,但并非最不重要,请记住谷歌是你的朋友。首先在Google中搜索您的查询,尝试实施解决方案或建议。在那之后,如果你仍然遇到问题,请回到这里。



所以,开始吧。祝好运。 :)

Hi! I'm studding computer engineering and I'm starting in programming . I have to prepare a inventory control system with c# ,using a binary tree for the view of the items in the stock (which are in the database) . could someone help me ? I need some instructions,recommendations,manuals,opinions , in fact everything you could give me is going to be good.thank you so much !

解决方案

First Solution
The solution would be that on the database side you have a column of Product ID as your primary key and some other column as needed. On your coding side, you will need a function to get all of productID on database and put them in an sorted array of int or long, depending on the number of product. From that you can simply create a function that look through that array using binary search to check the existent of the product.
Binary search algorithm.

Second Solution
You can create object class of product that contain ProductID and whatever needed. From that you can created Binary Tree using your productID to sort the object. To look up the inventory, you would have to create a function similar to Binary search algorithm

EDIT: Your table probably looks like :
PRODUCT_TABLE : PRODUCT_ID AS Primary Key,GROUP_ID As Foreign Key, PRODUCT_NAME, PRODUCT_PRICE
GROUP_TABLE : GROUP_ID As Primary Key, Group_Name

NOTE: You probably want 2 binary trees one for product and one for group. In the Group class and Product class will need the property that reference to one another


As you have not used C Sharp yet, I suggest you to learn it first.

MSDN is the best place to get all the resources related to the technology. You will find articles and sample codes also.

When you start learning C#, you will also build many demo apps. Those demos will help you to understand the concepts easily.

If you face any difficulty while programming, you can always post questions here specifying the exact issue. You can find many awesome articles on .NET here also.

Last, but not the least, remember that Google is your friend. Search your query in Google first, try to implement the solutions or suggestions. After that, if u still face problems, come back here.

So, get started. Good luck. :)


这篇关于关于c#中第一个应用的一般问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆