Object Reference Not Set to an Instance of an Object
I gotta tell you, if there is one killer exception message that n00b programmers bitch about, that's the one. And 99 percent of the time, the real problem is what's between the keyboard and the chair! Look, if you get this message it means you tried to use an object variable that's null. If it's null, that's either because you have a coding logic error that's allowing it to come back null, or some condition that you didn't forsee brought it back null and you didn't have defensive code to check for this. If it legitimately can come back in a state of Nothingness, then you need to test for that and code the rest of your logic accordingly. You CANNOT assume! Wanna know something else? Out of those 99 percent, a similar percentage of programmers have not taken the time to wrap their code logic in a Try / Catch or Try / Catch / Finally block. If they did, they wouldn't be posting inane questions to forums and newsgroups about it! It's OK if you are li...