In your web.config, add a connection string entry:
<connectionstrings><br />
<add><br />
name="LocalSqlServer" <br />
connectionString="Data Source=amit\sqlexpress;Initial <br />
Catalog=MyDatabase;User ID=userName;Password=password"<br />
providerName="System.Data.SqlClient"<br />
/><br />
</add></connectionstrings>
and then on
.cs Page U can get connection by Using
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["LocalSqlServer"].ConnectionString);