Error saving typed dataset (.NET 2.0) - Object not set to referenc

G

Guest

I have an ASP.NET project with a typed dataset (with table adapters). The
table adapters' connection string property was set to get the connection
strings out of the web.config file. I was able to add new table adapters,
and all worked well for a while.

Now I need to add another table adapter and cannot do it. When I try to add
a new one, the connection strings from the web.config file no longer show up
in the wizard's connection string dropdown. Also, all of the existing table
adapters' connection string properties say "Unable to find connection
'dbname' for object 'web.config'. The connection string could not be found
in application settings, or the data provider associated with the connection
string could not be loaded. Oddly enough, if I run the project, the existing
table adapters have no problem connecting to the database.

Since I couldn't add a new table adapter, I figured I'd try it the
old-fashioned way and just add a DataTable and update it in the code (I've
had to work around many bugs in VS2005, so I'm used to it). However, when I
try to add a DataTable and click "Save", I get an "Object not set to a
reference of an object." messagebox.

When I click on "View Code" for the dataset, I get a couple more "Object not
set..." message boxes, then the schema loads. Then I notice there are over
100 warnings aobut attributes not being declared.

I can delete the entire dataset and rebuild it from scratch, and it will
work fine for a little while. After a few days though, it gets back to this
error. Any ideas?
 
G

Guest

Never mind, I was able to re-establish the connection strings in the
web.config file. I just removed the ones that were already there. Then I
drug another select stored procedure from the same database into the dataset
from the Server Explorer. It re-created the connection string in the
web.config file. Now all my table adapters are working correctly.

Strange that it created the exact same connection strings that were not
working before. Will see if I have to keep doing this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top