![]() |
| ||
| Object reference not set to an instance of an object. Ah man , ive been adjusting the code so much ... I am trying to make a treeview that display's all the directories and files on theserver (SO FAR SO GOOD) ... Here's my code to retrieve Directories and files public string[] GetFileList() This works fine indevidually , but when i try to combine the two:
i get an error stating that "Object reference not set to an instance of an object." (LENS ON [foreach (string filename2 in Child_Name)] ) Can anyone maybe give me a clue ?? i dont even know why its complaining because it aught to work... Happy coding |
| ||
| Re: Object reference not set to an instance of an object. It works with me! but try to debug, that's the one who you can fully trust in. |
| ||
| Re: Object reference not set to an instance of an object. Its almost certainly correct: as you go to use Child_name, but you checked parent wasnt null, so child could be |
| ||
| Re: Object reference not set to an instance of an object. It also works proper with me, but have some thing, that you should look at: 1. You check Parent_Name 2 times. And second one is inside the first one. It looks like question: "Are you really sure that (Parent_Name != null)" ;P treeView1.Nodes.Clear();and if (Parent_Name != null) 2. I suppose you should do that: treeView1.Nodes.Add(ParentNode);after you fill with data the ChildNode of this ParentNode. Good luck :) |
| ||
| Re: Object reference not set to an instance of an object. Which is what I said in a lot less of a post. |
| ||
| Re: Object reference not set to an instance of an object. Oh yeah :( sorry. First part is your's. Wasn't about to do things like that O.O ... it seems that I need rest a bit ;P |
| ||
| Re: Object reference not set to an instance of an object. Welll well well, i feel like a retard now hahahahahahahaha!!! Although , thats not the problem... The problem lies here Quote:
So i did this private void btnDoIt_Click(object sender, EventArgs e) WORKS LIKE A BOMB!!!!!!!! cept i still get an error on my try -> catch saying Quote:
|
| ||
| Re: Object reference not set to an instance of an object. Look i know the problemo is this Quote:
|
| ||
| Re: Object reference not set to an instance of an object. Well if Child_name is null, then look at your function |
| All times are GMT -4. The time now is 8:30 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC