To call connection string from Web.config using Asp.net-C# follow as following steps:
Step 1: Add ConnectionString to Web.Config file in your website project:
<connectionStrings><add name="connString" connectionString="Data Source=.;Initial Catalog=HCMS;Persist Security Info=True;User ID=sa;Password=****"/></connectionStrings>
Step 2: Now goto code page, where you want to use ConnectionString:
Use related namespace:
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
Use ConnectionString as below:
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["connString"].ConnectionString);
Here, this is done to call connection string on your code page from Web.Config file using ConfigurationManager.
Conversion Conversion Emoticon Emoticon