John Baird
Coatesville, Pennsylvania, United States
Environment versions
Network:
Windows 2003 Server
Check to see if its null before you use it.
>But, this now leads to another error. When I exit the program, I get the following message:
>
>"Object reference not set to an instance of an object", and the line pointed to is
>
>this.SessionID = (int) listBox1.SelectedValue;
>
>In the debugger's watch list, I can see that SessionID = 76, the last thing I processed. this.listBox1 seems to still exist. But, this.listBox1.SelectedValue is null.
>
>Should I be cleaning up or something to prevent this? Or should I just check for SelectedValue not NULL before I try to use it?
>
>Thanks
>Jim
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only