In Web.config
<configuration>
<connectionStrings>
<add name="ConnectionStringName" connectionString="Data Source=SQLSERVER;Initial Catalog=DBNAME;User ID=ID;Password=PASS" providerName="System.Data.SqlClient"/> </connectionStrings>
</configuration>
In DAL file
using System.Configuration;
static string connStr =ConfigurationManager.ConnectionStrings["ConnectionStringName"].ConnectionString;
<configuration>
<connectionStrings>
<add name="ConnectionStringName" connectionString="Data Source=SQLSERVER;Initial Catalog=DBNAME;User ID=ID;Password=PASS" providerName="System.Data.SqlClient"/> </connectionStrings>
</configuration>
In DAL file
using System.Configuration;
static string connStr =ConfigurationManager.ConnectionStrings["ConnectionStringName"].ConnectionString;
No comments:
Post a Comment