Creative2
Freshman
Hi Again guys,
I have a list box on my form, I am trying to fill the listbox from database(by calling a sub) when form loads, which works fine, but when i try to set listbox's selected index to the first item, it gives me following error:
"Object Reference not set to an instance of an object", although after clicking the error message, it sets the index.
I wrote my codes in form_load event and I also tried to put em after InitializeComponent() call. I am getting same error.
Any idea to get over it?
Your help would be greatly appreciated.
I have a list box on my form, I am trying to fill the listbox from database(by calling a sub) when form loads, which works fine, but when i try to set listbox's selected index to the first item, it gives me following error:
"Object Reference not set to an instance of an object", although after clicking the error message, it sets the index.
I wrote my codes in form_load event and I also tried to put em after InitializeComponent() call. I am getting same error.
Any idea to get over it?
Your help would be greatly appreciated.