Pages

Showing posts with label connection string. Show all posts
Showing posts with label connection string. Show all posts

Sunday 14 June 2015

Connection String in Web.config

The web.config file stores the website configuration data, the connection string is used to store information on database connection.

The connection  string to connect to a local sql server database is :-

<connectionStrings>
    <add name="conn" connectionString="Data Source=.; Initial Catalog=DataBaseName; Integrated Security='True'" providerName="System.Data.SqlClient"/>
  </connectionStrings>

The connection string to connect to a server :-

<connectionStrings>
    <add name="conn" connectionString="Server=ServerAddress; Database=DatabaseName; User ID=userID; Password=password; Trusted_Connection=False" />
  </connectionStrings>