Simple Way to Access the connection string value from web.config file
It's very simple to access the connection string in the project to establish connection from web.config file.
Here is the code
Web.config
start with "<" 'appSettings' and close with ">"
"<"add key="sqlconnstr" value="Data source=Database ServerName;database=DatabaseName;user id=UserId;password=Password;connect timeout=0;" "/>"
"" appSettings ">"
inside Code Behind
SqlConnection sqlconn;
sqlconn = new SqlConnection(ConfigurationManager.AppSettings["sqlconnstr"].ToString());
you can access anywhere in your project.