It is very is try this code
You have to write this code in web.config file of your asp.net project and then call the connection from your web form here is the code for web.config
<connectionStrings>
<add name="ConnectionNameHere"
connectionString="Data Source=(localhost);Initial Catalog=DataBaseName;User Id=UserName;Password=password;"
providerName="System.Data.SqlClient" />
</connectionStrings>
code for calling connection, write this code in code behind file (default.aspx.cs)
private string connectionString()
{
return WebConfigurationManager.ConnectionStrings["ConnectionNameHere"].ConnectionString;
}
Please, if this is a answer mark as answer