I am using VS 2008 and C#.NET, I have the connectionstring for an SQL Server database stored in app.config, I believe I should be able to access it using ConfigurationManager, as follws:
using System;
using System.Configuration;
...
string ConnectionString = ConfiurationManager.ConnectionStrings("ConnectionStringName").ToString();
However, I getting build errors telling me that the name ConfigurationManager does not exist in the current context.
What am I doing wrong?
Loading
Kirtan PatelPosted May 16, 2010, 11:32 PM
string connectionString = Properties.Settings.Default.ConString.ToString();