Class modules with DataSets

corpse

Member
Joined
Dec 12, 2002
Messages
12
Location
chicago area
Im pretty new on the .net scene, so lemme explain what I wanted to do in VB6 that seems hard to do in .NET.

Im redoing an order entry system, and was going to do it in vb6 with vb6 as the front-end which will exlusively access vb6-created active x dll com objects. These dlls will act as the data store along with their respective methods, perfect example is the Order to Payments relationship...

Orders collection ---> Order object
Order properties:
intOrderNumber, txtCustomerName, CanCancel, Payments
Order methods:
CancelOrder, CompleteOrder

(objPayments) Payments collection ---> Payment object
same as above (kinda) as the payment object will have properties that are actual data from the database or other misc. properties

Now, in the vb6 I would have loaded the data up and simply built up my collections my doing an Add method (into the collection) for each item - it worked great, cuz then in my UI I could call something easy like... objOrder.Payments(1).Validate, and to get the payment ID I could do: objOrder.Payments(1)!guidPaymentTag

But in .net, Im having a real hard time figuring out I can do this stuff using DataSets.. I would still like to have my Orders collection, Order object, LineItems collection and LineItem object (etc...), and in each object have my "data" properties and "other" properties, along with methods..

If I build a DataSet, I dont see how my LineItems or Payments collection can work properly?

<sigh> Thanks for your patience in answering!
 
Not sure why this thread was moved - I think it has way more to do with class structure and not data access :-/

Let me try a different approach..
In my UI, I would like to access my "business objects" that are stored in the dll.
Some things Id access... (assume I did all the necessary Dims already)..
Orders(1).InvNum (database property, invoice number)
Orders(1).Date_Created (db property)
Orders(1).EmployeeName (NOT a direct db property, this might be a lookup of hte employee id and return the employee full name).
Orders(1).SendConfirmation (this can be a method to send an e-mail confirmation to the customer).

Orders(1).LineItems.Count (returns number of lineitems)
Orders(1).LineItems(1).ItemID (db property)
Orders(1).LineItems(21).Cancel() (Method to cancel out the line item)..

As you can see, the order object (and child objects) have a mix of properties and methods, and some of those properties may not be data from the database, but other properties just part of the object.

If Im using a complex DataSet with multiple related tables, how would I (or can I?) use that dataset object model in mine? (refer to the code bits above)..
 
Check out Rockford Lhotkas site think its http://www.lhotka.net and check out the articles on his VB .NET Business Objects book he talks about how the above can be accomplished, using a DataSet as a collection and passing it down to each Order Object..
 
Back
Top