Unable to find connection 'dbname' for object 'Web.config'.

Last night I went to bed and my project in Visual Studio 2005 worked just fine.  I start VS this morning and I get:

Unable to find connection 'dbConnectionString (Web.config)1' 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.

What I don't understand is, this worked yesterday, and all day yesterday I didn't touch my web.config file.  Also, the database, which is an SQL Server is up, and I was able to access it using Enterprise Manager.

Any ideas what caused this?  I'm assuming I could create a new dataset and redo my tableadapters, but if this happend once, I'm sure it will happen again.

Any help would be appreciated! (let me know if i need to post additional info)
Who is Participating?
Anurag AgarwalPython DeveloperCommented:
This is a problem reported to MS and as far as i read on internet MS also acceptd it as bug in VS2005. Follow the below link..
In this link a long discussion is made and the users have posted some tricks to solve this problem.
May any trick work for you :-)
1. check you DO have the connection string on your config file in the correct place, even if you did not change it.

2. Did you try to restart your machine?

3. is your sql server on the same machine? Do you manage to open the management studio and run a query?

steverguyAuthor Commented:
The connection strings are located right below the <configSections> and right about the <system.web> section.  Does that seem correct?  I am new to ASP.NET and this was autogenerated.
    <add name="mydbConnectionString" connectionString="Data Source=myser.COM;Initial Catalog=mydb;Persist Security Info=True;User ID=username;Password=xxxxxx" providerName="System.Data.SqlClient" />

The SQL Server is hosted remotley.  I am going to try restarting my computer to see if that works.

Thanks for your hquick response!
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

steverguyAuthor Commented:
Restarting the computer did not fix the problem.
is there any chance you have duplicate connection strings in your config file?
Try to regenerate the connection string. Do you work with a dataset?
steverguyAuthor Commented:
I deleted the dataset and created a new one, which regenerated the connection string.  It is working now.  What an annoying bug!

Thanks for your help!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.