Last post Nov 28, 2006 04:55 PM by arsalan
Apr 01, 2006 06:54 AM|GerEielts|LINK
Hi, I have the following code:
Me_Node.Text = ds.Tables("Medewerkers").Rows(RowLoopIndex).Item("Achternaam")
Med_ID = ds.Tables("Medewerkers").Rows(RowLoopIndex).Item("MedewerkerID")
Pr_Node.Text = ds.Tables("Projecten").Rows(TweedeRowLoopIndex).Item("Projectnummer")
Explanation and problem:
First I populate a dataset with employees and then loop through this dataset ds.Tables("Medewerkers").
From each employee I want to know on which Projectes he/she is working. So I populate another dataset ds.Tables("Projecten") where the employeesID in "Projecten" = employeesID in "Medewerkers". So far so good. When the
first employee and he/she is working on two projects.. these two projects are added, but....... when the first loop (through "Medewerkers) repeats (so RowLoopIndex = 1), I got the error on the line: ""
Me_Node.Text = ds.Tables("Medewerkers").Rows(RowLoopIndex).Item("Achternaam")""
Question: object reference is set in my opinion (why would the app take the first employee correctly and not the second one ??). Besides: when looping the dataset with "Projecten" there is no problem with the second entry???
Help is appreciated and when the problem is not understandable enough, dont hesitate to ask.
Apr 12, 2006 06:23 AM|GerEielts|LINK
I solved it by using a DataReader in stead of a DataSet in the first loop.... It works, but it didnot resolve the problem.
Nov 28, 2006 04:55 PM|arsalan|LINK
You havent provided the code where you declared the TreeView control?
I had this same error but in some other scenario i got it resolved it by declaring the control as follows.