How To Setup Connection String In ASP.NET To SQL SERVER
Here we consider how to setup connection string to SQL Server in Asp.Net.
First of all navigate to Views --> Server Explorer on Visual Studio.
Right Click on Data Connections --> Add Connection.
A new window will come as shown below. Here provide Server Details.
Provide Server Name, Log On Information, Database Name.

And then press OK Button.
This newly added database will be listed under Data Connection in Server Explorer.
Right Click on this Database Connection and Select Properties.
On Properties Window, Copy Connection String as shown below.

On Web.Config file, inside configuration Section, add ConnectionString node as shown below.
<connectionStrings >
<add
name="conString"
connectionString="Paste Your Connection String Here"
providerName="System.Data.SqlClient"/>
</connectionStrings>
Inside connectionStrings node, paste your Connection String inside connectionStrings="".
On code behind, you can set up connection variable as shown below.
SqlConnection connectionString = new SqlConnection(
WebConfigurationManager.ConnectionStrings["conString"].ConnectionString);
That's all, now you can make use of connectionString Variable for further database operation.