Showing posts with label ASP.NET Study Material. Show all posts
Showing posts with label ASP.NET Study Material. Show all posts

Wednesday, 23 May 2012

Connection string syntax in ASP.NET


For Windows Authenication:

   <ConnectionStrings>
     <Add Name="ConnectionStringName"
ConnectionString="Server=localhost;Database=dbname;Trusted_Connection=True;"
ProviderName="System.Data.SqlClient"/>
         </ConnectionStrings>

For SQL Server Authenication:
    <ConnectionStrings>
<Add Name="ConnectionStringName
"ConnectionString="Server=localhost or IP Adress;
Database=dbname;uid=sql server username;
Pwd=sql server user password"
Provider Name="System.Data.SqlClient"/>
</ConnectionStrings>