Monday, July 9, 2012

Get the ConnectionString from the Web.Config file with only one line of code (C#)


Get the ConnectionString from the Web.Config file with only one line of code (C#):
var conString = ConfigurationManager.ConnectionStrings["LocalSqlServer"];
string strConnString = conString.ConnectionString;

No comments: