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; //定义数据库连接字段
转载于:https://www.cnblogs.com/webman/archive/2006/09/01/492074.html