Click here to Skip to main content
15,905,914 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
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.
Posted
Updated 27-Dec-11 16:33pm
v2
Comments
Sergey Alexandrovich Kryukov 27-Dec-11 23:33pm    
Not clear. It all depends on what "Suppliers" should do with Supplier and its descendants.
--SA

 
Share this answer
 
v2
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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900