Joe Levi:
a cross-discipline, multi-dimensional problem solver who thinks outside the box – but within reality™

HOWTO: Use a ConnectionString from the web.config in your ASP.NET .CS code

In your .cs code you can pull the value of any ConnectionString using the following concept (where “blah” is the name of your connectionString as defined in your web.config file).

cn = new SqlConnection(ConfigurationManager.ConnectionStrings["blah"].ToString());

Share

You may also like...

Leave a Reply