Wednesday, 14 January 2015

Adding Connection string in web.config

Connections String is a piece of code used to connect to the database from the main code.

It is placed in web.config file of the code
you have to add a reference on above of the code

using System.Web.Configuration; 

<connectionStrings >
    <add
         name="myConnectionString" 
         connectionString="Server=YourServerAddress;Database=Databasename;User ID=ServerloginId;Password=ServerPassword;Trusted_Connection=False;"
         providerName="System.Data.SqlClient"/>
</connectionStrings>


No comments:

Post a Comment