J
Joe
Hi
I have a dataset with 3 tables and 2 relations
Is there a way to when I am at 1 row to tell if there is a relation on that
row ???
I have the code hardcoded but try to make it work if the # of tables and
#relations increase or decrease
So I can just pass any dataset and walk thru the rows??
Thanks
for (int p = 0; p < ds.Tables[1].Rows.Count; p++)
{
//Get Childs rows of parent
DataRow [] rows = ds.Tables[1].Rows[p].GetChildRows("Level1");
for ( int t = 0; t < rows.Length; t++)
{
DataRow drc = rows[t]; //Current row
//Get Childs rows of parent
DataRow [] childrows = drc.GetChildRows("Level2");
}
}
I have a dataset with 3 tables and 2 relations
Is there a way to when I am at 1 row to tell if there is a relation on that
row ???
I have the code hardcoded but try to make it work if the # of tables and
#relations increase or decrease
So I can just pass any dataset and walk thru the rows??
Thanks
for (int p = 0; p < ds.Tables[1].Rows.Count; p++)
{
//Get Childs rows of parent
DataRow [] rows = ds.Tables[1].Rows[p].GetChildRows("Level1");
for ( int t = 0; t < rows.Length; t++)
{
DataRow drc = rows[t]; //Current row
//Get Childs rows of parent
DataRow [] childrows = drc.GetChildRows("Level2");
}
}