My hope is that somebody has a thought on this, or can point to toward an
article that's useful. I have the following:
DataSet ds = new DataSet();
ds.ReadXml("MyData.xml");
Each MainTable entry has subtable relations. Here's my current approach:
foreach(DataRow row in ds.Tables["MainTable"].Rows
{
Console.WriteLine("Name = {0}", row["Name"].ToString());
...
foreach(DataRow subrow in row.GetChildRows(MyCurrentRelation)
{
}
}
This approach requires me to loop through the DataSet before going to the
code above, because GetChildRows requires me to know all the
MyCurrentRelation. I can't believe I have to loop through the dataset twice.
This seems way too cheezy.
Any pointers on looping through a table with related tables in a DataSet in
one nested loop sequence?
Thanks,
--
Randy