Missing Configuration Manager

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?
LVL 1
NigelRocksAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
You need to add a reference to the System.Configuration.dll to your project.
0
NigelRocksAuthor Commented:
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
Bob LearnedCommented:
I am going to assume that ConfigurationMangager is a typo, right?  Is this a web site or a web application (.csproj file)?
0
OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

NigelRocksAuthor Commented:
Yes, that's a typo.  It's a web site.
0
varungdCommented:
try this

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

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bob LearnedCommented:
ConfigurationManager is the 2.0 and 3.5 way, and that is the 1.1 way, so let's not go there, OK?
0
Bob LearnedCommented:
What happens with a new temporary test web site?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.