The loop above is within another loop that is:
for (int i = 0; i < NoOfRows; i++)
{
Obj = myDataSet.Tables["myTable"].Rows[i].ItemArray;
}
that
int NoOfRows = myDataSet.Tables["myTable"].Rows.Count;
I first put the first node (root node in the tree):
for (int i = 0; i < NoOfRows; i++)
{
Obj = myDataSet.Tables["myTable"].Rows[i].ItemArray;
if (Obj[8].ToString()=="")
{
TreeNode RootNode = new TreeNode();
RootNode.Name = Obj[0].ToString();
RootNode.Text = Obj[10].ToString();
treeView1.Nodes.Add(RootNode);
}
}
and as I said before, each time one node is added to the treeview.
But the treeview.nodes.count after adding another node does not changes. I think that I should update it somehow in order to get the newly added node.
thanks for your fast reply!