zoukankan      html  css  js  c++  java
  • 关于sql access excel以及在web.config中数据库连接字符串的写法

    连接 SQL Server 2008/2005/2000:

    Provider=SQLOLEDB;Data Source=(local);Initial Catalog=db;Integrated Security=SSPI;

    Provider=SQLOLEDB;Data Source=(local);Initial Catalog=db;User ID=登录名;Password=密码;

    连接 SQL Server 2008/2005 Express:

    Provider=SQLOLEDB;Data Source=(local)\SQLEXPRESS;Initial Catalog=db;Integrated Security=SSPI;

    Provider=SQLOLEDB;Data Source=(local)\SQLEXPRESS;Initial Catalog=db;User ID=登录名;Password=密码;

    连接 Access 2007:

    Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Access2007文件位置;Persist Security Info=False;

    连接 Access:

    Provider=Microsoft.Jet.OleDb.4.0;Data Source=Access文件位置;

    连接 Excel 2007:

    Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Excel2007文件位置;Extended Properties='Excel 12.0;HDR=NO;'

    连接 Excel:

    Provider=Microsoft.Jet.OleDb.4.0;Data Source=Excel文件位置;Extended Properties='Excel 8.0;HDR=NO;'

    连接 MySQL:

    driver={mysql odbc 3.51 driver};server=127.0.0.1;uid=uid;pwd=pwd;database=db

    driver={mysql odbc 5.1 driver};server=127.0.0.1;uid=uid;pwd=pwd;database=db

    web.config 中连接 SQL Server 2008/2005/2000:

    <add name="MySqlServer" connectionString="Data Source=(local);Initial Catalog=db;Integrated Security=SSPI;" providerName="System.Data.SqlClient"/>

    <add name="MySqlServer" connectionString="Data Source=(local);Initial Catalog=db;User ID=登录名;Password=密码;" providerName="System.Data.SqlClient"/>

    web.config 中连接 SQL Server 2008/2005 Express:

    <add name="MySqlServer" connectionString="Data Source=(local)\SQLEXPRESS;Initial Catalog=db;Integrated Security=SSPI;" providerName="System.Data.SqlClient"/>

    <add name="MySqlServer" connectionString="Data Source=(local)\SQLEXPRESS;Initial Catalog=db;User ID=登录名;Password=密码;" providerName="System.Data.SqlClient"/>

    web.config 中连接 App_Data 中的数据文件:

    <add name="MySqlServer" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Data.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>

  • 相关阅读:
    地图校正方法心得
    投影的心得点滴
    android 打包 apk keystore
    scp命令详解
    ubuntu11.10真机调试nopermissions
    android adb server is out of date
    ubuntu删除默认jdk
    android 运行 错误 总结
    android file .apk is not a valid zip file adb install
    ubuntu系统目录结构
  • 原文地址:https://www.cnblogs.com/jinianjun/p/2288087.html
Copyright © 2011-2022 走看看