Generating a collection from a data set table

G

Guest

Hi,
I have a strongly typed dataset with 2 tables: Orders and OrdersDetails,
that have a parent-child relationship by OrderId.
I want to be able to work sequentually on each row in Orders and in
OrderDetails in the following manner:
foreach (TableRow HeadRow in Orders.Rows)
{
...
foreach(TableRow DetRow in OrdersDetails.Rows)
{
.....
}
}
My question is how can I make sure the inner foreach works only on the Rows
that have the same OrderId (the OrderId from the outter foreach)

Thanks
 
C

Cor Ligthert [MVP]

doh,

Completely unreadable.
Why are you not using the every time the childcollection by the
getchildrows and do in that your foreach.

Why are you not using in your outerloop every time the method getchildrows
to get the childrowcollection of an order and go through that using a
foreach.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top