How to connect database to webconfig file in asp.net

Manideepgoud
Posted by Manideepgoud under ASP.NET category on | Points: 40 | Views : 339
Connecting database to webconfig.file in asp.net
We have to take webconfigfile and give the connection strings as follows

<configuration>
<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=MUKUL-PC\SQLEXPRESS;database=mydatbase;Integrated Security=true;"/>
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.5.2" />
<httpRuntime targetFramework="4.5.2" />
</system.web>
</configuration>


In the above code we have connnection strings in the webconfig.file, we have to give the data-source and database name , which we have given in the sqlserver.

Comments or Responses

Login to post response