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"/>

  • 相关阅读:
    selenium之css选择器高级用法
    常系数线性齐次递推新理解
    关于莫队本质的理解
    2021.5.8总结
    决策单调性优化dp
    字符串 复习
    5.1总结
    树分块 学习笔记
    莫反 复习
    P4570 [BJWC2011]元素
  • 原文地址:https://www.cnblogs.com/jinianjun/p/2288087.html
Copyright © 2011-2022 走看看