get connection string from web.config in c#

94

get connectionstring from web config c# -

// Add a using directive at the top of your code file    
using System.Configuration;

// Within the code body set your variable    
string cs = ConfigurationManager.ConnectionStrings["connectionStringName"].ConnectionString;

Comments

Submit
0 Comments