J
jmDesktop
I have this:
foreach (DataRow row in myDS.Tables["myTable"].Rows)
{
int ctr=0; //counter for child node
//create a parent node for each new row
trvRetrieved.Nodes.Add(new
TreeNode(myIdNumber));
//children of that parent row
trvRetrieved.Nodes[ctr].Nodes.Add(new
TreeNode(myPerson));
trvRetrieved.Nodes[ctr].Nodes.Add(new
TreeNode(myAddress));
ctr++;
}
Is there a way to get the current row iteration number I am on instead
of using the by hand int counter?
Thank you.
foreach (DataRow row in myDS.Tables["myTable"].Rows)
{
int ctr=0; //counter for child node
//create a parent node for each new row
trvRetrieved.Nodes.Add(new
TreeNode(myIdNumber));
//children of that parent row
trvRetrieved.Nodes[ctr].Nodes.Add(new
TreeNode(myPerson));
trvRetrieved.Nodes[ctr].Nodes.Add(new
TreeNode(myAddress));
ctr++;
}
Is there a way to get the current row iteration number I am on instead
of using the by hand int counter?
Thank you.