Error when adding new Data Source

I've experienced the strangest error when I try to add a new datasource via the Data Sources window in Visual Studio. The Data Source Configuration Wizards pops up, I select I want to bind to an object, click on next and get the following error:


(Click to view larger image)

Yes, the dreaded Object reference not set to an instance of an object error.

After a considerable amount of time spent checking references, adding references, re-building and a lot of profanity, I finally discovered that VS expects a class in the root of your project for the Data Source Configuration Wizard to bind to an object. I moved all my forms and classes to folders within my project, thus I had no classes in the root of my project.

After creating an empty Class1.vb in the root of my project the error went away.


Go figure!!

Print | posted on Wednesday, September 05, 2007 8:23 AM

Comments on this post

No comments posted yet.

Your comment:

 (will show your gravatar)
 
Please add 7 and 6 and type the answer here: