ConfigurationManager (Where is it?)

Posted Thursday, September 22, 2005 8:47 AM by C-Dog's .NET Tip of the Day
As I might have pointed out in the past, the ConfigurationSettings object is deprecated and has been replaced with the ConfigurationManager object.  This object gives you direct access to sections of the web.config or machine.config including the new <connectionStrings> section.  Sometimes when you try to use it, you may notice it doesn't compile or work with intellisense.  This is because they moved the configuration classes out of System.dll and into the new System.Configuration.dll.  So therefore, if you want to make use of it you have to include that reference in your project. 

The syntax is the same as the ConfigurationSettings class.
ConfigurationManager.AppSettings["MyString"];
or
ConfigurationManager.ConnectionStrings["MyConnectionString];

Read the complete post at http://www.dotnettipoftheday.com/blog.aspx?id=55