常用的数据库链接串

    <!--
    Access 2007:    Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;Persist Security Info=False;
    Access 2000:    Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;User Id=admin;Password=;
    -->
    <add name="Access" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\myDatabase.mdb;User Id=admin;Password=;" />
    <!--SQL Server 数据库连接方式
    SQL Server 2008:    Provider=SQLNCLI10;Server=myServerAddress;Database=myDataBase;Uid=myUsername; Pwd=myPassword;
    SQL Server 2005:    Provider=SQLNCLI;Server=myServerAddress;Database=myDataBase;Uid=myUsername; Pwd=myPassword;
    SQL Server 2000:    Provider=SQLOLEDB;Data Source=myservername;Initial Catalog=mydemodb;User Id=myusername;Password=mypasswd;   
    Trusted        :    Provider=SQLOLEDB;Data Source=myservername;Initial Catalog=mydemodb;Integrated Security=SSPI;
    -->
    <add name="SqlServer" connectionString="Provider=SQLOLEDB;Data Source=myservername;Initial Catalog=mydemodb;User Id=myusername;Password=mypasswd; " />
    <!-- Oracle数据库连接方式
    ms Provider    :    Provider=msdaora;Data Source=MyOracleDB;User Id=myUsername;Password=myPassword;
    Oracle Provider:    Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;User Id=myUsername;Password=myPassword;
    -->
    <add name="Oracle" connectionString="Provider=OraOLEDB.Oracle;Data Source=Db.X.Com;User ID=UID;Password=PWD" />
    <!--DB2数据库连接方式
    APPC 方式   :    Provider=DB2OLEDB;APPC Local LU Alias=MyAlias;APPC Remote LU Alias=MyRemote;Initial Catalog=MyCtlg;Package Collection=MyPkgCol;Default Schema=Schema;User ID=myUsername;Password=myPassword;
    IBM Provider:    Provider=IBMDADB2;Database=myDataBase;Hostname=myServerAddress;Protocol=TCPIP; Port=50000;Uid=myUsername;Pwd=myPassword;
    -->

你可能感兴趣的:(数据库链接)