Generating a collection from a data set table

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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.
 
Back
Top