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; //定义数据库连接字段
posted on 2006-09-01 11:31  hzman  阅读(288)  评论(0编辑  收藏  举报