asp.net 2.0下配置数据库sql和access二种写法
sqlserver:
<connectionStrings>
<add name="CustomerDataConnectionString" connectionString="Server=zj; UID=sa; PWD=123456; DataBase=test;"
providerName="System.Data.SqlClient" />
</connectionStrings>
access:
<connectionStrings>
<add name="ConnectionString_Access" connectionString="/data/blog.mdb"/>
</connectionStrings>
连接字符:
private static string CONNECTIONSTR = ConfigurationManager.ConnectionStrings["CustomerDataConnectionString"].ConnectionString; //定义数据库连接字段
<connectionStrings>
<add name="CustomerDataConnectionString" connectionString="Server=zj; UID=sa; PWD=123456; DataBase=test;"
providerName="System.Data.SqlClient" />
</connectionStrings>
access:
<connectionStrings>
<add name="ConnectionString_Access" connectionString="/data/blog.mdb"/>
</connectionStrings>
连接字符:
private static string CONNECTIONSTR = ConfigurationManager.ConnectionStrings["CustomerDataConnectionString"].ConnectionString; //定义数据库连接字段