C#OOPS集合命名空间,实现问题 [英] C# OOPS Collection Namespace, problem implementing

查看:93
本文介绍了C#OOPS集合命名空间,实现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我是OOPS的新手,但不是编程人员,我希望采用与.Net完全相同的方法来处理DataSet和DataTables.

像DataSet ds = new DataSet();

ds.Tables [0]-> (有一个表的集合)

除此之外,我们还分别创建DataTable的对象.

我正在为我的供应商寻找相同的方法



供应商supp = new Suppliers()
供应商(0)

我也想创建单个对象

供应商供应=新的Supplier();

Suppliers.addsupplier(supp)像这样

但是,这还不是终点.我想进一步继承地址簿和电话簿.

如果我想在网格中向供应商展示,我需要一个数据表,该数据表可以通过该方法提供.

希望您能理解我的需求.

提前谢谢您.

最好的问候

贾德夫·哈特里(Jaidev Khatri)


我尝试了收集列表,继承等.

Hi,

I am very new to OOPS but not in programming, I like to have exactly the same approach as .Net have for DataSets and DataTables.

Like DataSet ds= new DataSet();

ds.Tables[0] --> (a collection of tables are there)

apart from it, we also create object of DataTable individually.

I am looking the same approach for my Suppliers

Like

Suppliers supp=new Suppliers()
supp.Supplier(0)

also I want to create individual object

Supplier suppi = new Supplier();

Suppliers.addsupplier(supp) like this

But this isnt the end. I want further heirarchy to Addressbook and phonebook.

If I like to show the supplier in a Grid I would need a Datatable to be provided by a method from it.

I hope you understood what I am looking for.

Thank you in advance.

Best Regards

Jaidev Khatri


I tried Collection List, inheritance etc.

推荐答案

检查这些链接..

自定义集合 [如何在net2.0中创建自定义集合 [ ^ ]

自定义馆藏 [
check these links..

Googled[^]

Custom collection[^]

how to create a custom collection in net2.0[^]

Custom Collection[^]

hope this helps..


感谢您的早日答复,

是的,到目前为止,我所缺少的只是在子类的BaseClass中创建一个对象列表.

我遇到一个困难,就像我将电话簿作为供应商"的子类一样.我也有客户类,我也喜欢电话簿.

因此,我应该在每个类中声明电话簿类,还是有什么方法可以声明电话簿,客户,供应商等所有类都可以将其用作子类.

最好的问候

贾德夫·哈特里(Jaidev Khatri)
Thanks for your early reply,

Yeah I had done by now, what I was missing is just to create an object list in BaseClass of the subclass.

I have one difficulty like if I make phonebook as subclass of Supplier. I also have customer Class where I like to have phonebook too.

So, should I declare phonebook class in every class or is there any way to declare the phonebook which all classes like customer, supplier can use as subclass.

Best Regards

Jaidev Khatri


这篇关于C#OOPS集合命名空间,实现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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