How to read the connection string?

  • Thread starter Thread starter ABC
  • Start date Start date
A

ABC

How to read the connection string from web.config? I known .NET framework
2.0 has new features about connection settings, but I don't know how to use.



Thanks
 
Hi ABC,
you can use the ConfigurationManager class to read the connection string
settings from the .config file, located inside the <connectionString> element
i.e.

ConfigurationManager.ConnectionString["nameofcsinconfig"]. ConnectionString

Hope that helps
Mark R Dawson
http://www.markdawson.org
 
Thanks


Mark R. Dawson said:
Hi ABC,
you can use the ConfigurationManager class to read the connection string
settings from the .config file, located inside the <connectionString>
element
i.e.

ConfigurationManager.ConnectionString["nameofcsinconfig"].
ConnectionString

Hope that helps
Mark R Dawson
http://www.markdawson.org



ABC said:
How to read the connection string from web.config? I known .NET
framework
2.0 has new features about connection settings, but I don't know how to
use.



Thanks
 
Back
Top