DEV Community

Blake McKenna
Blake McKenna

Posted on

Object reference not set to an instance of an object

I'm pretty new to C# coming from a VB.Net environment. This error message isn't new to me, however, in this context, I'm really not sure why this is happening. I've created a datasource with several tables which each table is connected to a ListBox control via a DataAdapter. If I comment out the line in error, the program runs fine. It's just this initial assignment to the variable that I receive this error. Please see attached image.

Image description

Top comments (0)