parent and child records

  • Thread starter Thread starter MR
  • Start date Start date
M

MR

If I have a select that joins two tables, say OrderMaster and OrderDetail,
how can i generate a recordset, or recordview, that would allow me to handle
the returned data so that i can process the data thru an outerloop on the
masterrecords and an innerloop on the detail records?
 
MR,

The recordset is not an ADONET datasource.

While AFAIK an join create one datatable in ADONET.

Can you be a little bit more clear if you are talking about the use of
ADONET?

Cor
 
yes i am using ado.net. i mis-wrote. i did not mean recordset (sorry old
technology), but dataset or other object
 
You can do it a few different ways but the most efficient is to use
GetChildRows. Do a foreach or for x loop on the parent dataset, then for
each of the rows in that loop, use the
http://msdn.microsoft.com/library/d...rfSystemDataDataRowClassGetChildRowsTopic.asp
GetChildRows method to iterate through the child rows there.

There are other ways to do this, like creating dataviews and setting the
rowfilters, but they are horribly inefficient--- your best bet if I
understand you correctly is to use the GetChildRows. If I misunderstood you
though - please let me know ;-)
 
Back
Top