Sunday, November 16, 2014

Read connection string from web.config

Add System.Configuration as a reference.
For some bizarre reason it's not included by default.

System.Configuration.ConfigurationManager.
    ConnectionStrings["connectionStringName"].ConnectionString;

No comments:

Post a Comment