Hi friends
I want to know how can we access a connection string from web config file in web application ?
Thank you.
Access a Connection String From Web Config File in Web Application
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


VulpesRank #55 · 29.2K reputationPosted May 31, 2012, 4:34 AM EDT
http://msdn.microsoft.com/en-us/library/ms178411.aspx
Satyapriya NayakRank #47 · 31.5K reputationPosted May 31, 2012, 6:32 AM EDT
In web.config file
Call it in webpage as
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["dbconnection"].ToString());
Thanks