Hi,
Use this namespace :
using System.Data.SqlClient;
declare sql connection class:
SqlConnection Con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["testConnectionString"].ToString());
Con.Open();
put this one on web.config file and set four parameters as per your sql server Data Source name, Initial Catalog, User ID and Password.
<connectionStrings>
<add name="testConnectionString" connectionString="Data Source=;Initial Catalog=;User ID=;Password=;
providerName="System.Data.SqlClient" />
</connectionStrings>