   C#: populating treeview recursively
  Hi, I'm trying to populate a treeview getting data from an array, but I get a GPF and can't understand what's going on.Here is the function I'm using:  private void PopulateTreeView(int parentId, TreeNode parentNode)   { string[] myString = { "item1", "item2", "item3", "item4", "item5" };  TreeNode childNode;  foreach (var newstring in myString)  { if (parentNode == null)childNode = treeView1.Nodes.Add(newstring); elsechildNode = parentNode.Nodes.Add(newstring);  PopulateTreeView(counter++, childNode);  }   }At this stage I don't about nodes children, I'd be just happy to get a treeview showing like this:item1-item2--item3---item4----item5   
  Why would you get a GPF?  Shouldn't you get some sort of managed exception or something?  Is your program literally crashing with an access violation?Also, this code will almost certainly generate a stack overflow, as it will just keep calling itself indefinitely.   ;  That's right, I can see now that it just makes an infinite loop. But still can't figure out how to make a recursion out of it.   