[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Missing Configuration Manager

Posted on 2008-11-17
7
Medium Priority
?
603 Views
Last Modified: 2013-12-17
Experts,

I have a web app in C# that has always worked, but now when I run it I get an error on this line:

          using (SqlConnection gdbConnection = new SqlConnection(ConfigurationManager.ConnectionStrings[connectionStringName].ConnectionString))

It says that the "ConfigurationMangager" object doesn't exist.  I thought that class was part of the framework, but it's acting like I need to instantiate it myself.  What am I missing?
0
Comment
Question by:NigelRocks
  • 4
  • 2
7 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 22981553
You need to add a reference to the System.Configuration.dll to your project.
0
 
LVL 1

Author Comment

by:NigelRocks
ID: 22981815
Oh, sorry I forgot to mention I did that.  What's strange is that I don't see it listed anywhere in the solution explorer.  In fact, I don't see the "refrerences" folder anywhere, so after I right-click on the project and add the reference, I can't tell if it's been added or not.  Guess not.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 22981839
I am going to assume that ConfigurationMangager is a typo, right?  Is this a web site or a web application (.csproj file)?
0
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
LVL 1

Author Comment

by:NigelRocks
ID: 22981847
Yes, that's a typo.  It's a web site.
0
 
LVL 5

Accepted Solution

by:
varungd earned 2000 total points
ID: 22982334
try this

using (SqlConnection gdbConnection = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["connectionStringName"].ToString()))
 
 

Open in new window

0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 22983965
ConfigurationManager is the 2.0 and 3.5 way, and that is the 1.1 way, so let's not go there, OK?
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 22983968
What happens with a new temporary test web site?
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

873 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