webconfig中配置各種資料庫的連接字串(轉)

來源:互聯網
上載者:User

標籤:

一、在appSettings配置<appSettings>   <!--SQL Server-->  <!--<add key="SQLString" value="Database=MyData;Data Source=NICKYAN-PC;User Id=sa;Password=123123;"/>  <add key="DataDAL" value="RedGlovePermission.SQLServerDAL" />-->   <!--My SQL-->  <add key="SqlString" value="host=192.168.0.222;userid=root;password=123456;database=hr_db"/>      <add key="DataDAL" value="RedGlovePermission.MySqlDAL" />   <!--Oracle-->  <add key="SqlString" value="Data Source=NICKYAN-PC;User Id=PB_DB_USER;Password=123123;Integrated Security=no"/>      <add key="DataDAL" value="RedGlovePermission.OracleDAL" />   <!--OleDB-->  <add key="SQLString" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=RedGlovePermission.Web\DB\MyData.mdb;Persist Security Info=False"/>  <add key="DataDAL" value="RedGlovePermission.OleDBDAL" /> </appSettings> 二、在connectionStrings配置      <!--SQL Server-->     <add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
    <add name="ConnStr" connectionString="Database=DIS;Server=192.168.1.148;User ID=sa;Password=sa;" providerName="System.Data.SqlClient"/>   <!--My SQL-->   <add name="conStr"  connectionString="server=localhost;uid=root;pwd=123;database=test"providerName="System.Data.SqlClient"/>   <!--Oracle-->      <add name="TYRCC_connstr" connectionString="Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=china-007cb92da)  (PORT=1521))(CONNECT_DATA=(SERVICE_NAME=TYNHRK)));User ID=tytc;Password=123456;Unicode=True"  providerName="System.Data.OracleClient" />

     <add name="ConnectionString" connectionString="Data Source=TYNHRK;User ID=tytc;Password=123456.;Unicode=True"   providerName="System.Data.OracleClient" />
     <add name="ConnectionString2" connectionString="Expression: test_dataConnectionString" providerName="System.Data.SqlClient" />
   

webconfig中配置各種資料庫的連接字串(轉)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.