Solved

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

Posted on 2009-04-06
7
2,012 Views
Last Modified: 2012-05-06
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)
0
Comment
Question by:steverguy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 4

Expert Comment

by:amazingwolf1
ID: 24076151
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?

0
 
LVL 1

Author Comment

by:steverguy
ID: 24076306
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.
</configSections>
  <connectionStrings>
    <add name="mydbConnectionString" connectionString="Data Source=myser.COM;Initial Catalog=mydb;Persist Security Info=True;User ID=username;Password=xxxxxx" providerName="System.Data.SqlClient" />
  </connectionStrings>
 <system.web>

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

Thanks for your hquick response!
0
 
LVL 1

Author Comment

by:steverguy
ID: 24076380
Restarting the computer did not fix the problem.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Expert Comment

by:amazingwolf1
ID: 24076423
is there any chance you have duplicate connection strings in your config file?
0
 
LVL 11

Accepted Solution

by:
Anurag Agarwal earned 250 total points
ID: 24076444
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..
http://social.msdn.microsoft.com/forums/en-US/winformsdatacontrols/thread/08a48cad-619d-4421-b584-f2b5550ba6c5/
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 :-)
Anurag
0
 
LVL 4

Assisted Solution

by:amazingwolf1
amazingwolf1 earned 250 total points
ID: 24076464
Try to regenerate the connection string. Do you work with a dataset?
0
 
LVL 1

Author Comment

by:steverguy
ID: 24076523
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!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question