前言
在项目的开发过程中我门常常遇到会忘记数据库连接的配置的写法的尴尬处境。俗话说,好记性不如烂笔头。所以,mark一下。
Sqlserver数据库连接
<connectionStrings>
<add name="Conn" connectionString="Provider=MSDAORA;Data Source=demo;User ID=sa;Password=123456;" providerName="System.Data.OracleClient"/>
</connectionStrings>
Oracle数据库连接
<connectionStrings>
<add name="Conn" connectionString="server=.;database=demo;uid=sa;pwd=123456" providerName="System.Data.SqlClient"/>
</connectionStrings>
MySql数据库连接
<connectionStrings>
<add name="Conn" connectionString="host=127.0.0.1;Port=3306;Database=mysql;uid=sa;pwd=12346" providerName="MySql.Data.MySqlClient"/>
</connectionStrings>
Acces数据库连接
<connectionStrings>
<add name="Conn" connectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source={0}App_Data/demo.mdb" providerName="System.Data.OleDb"/>
</connectionStrings>
SQLite数据库连接
<connectionStrings>
<add name="Conn" connectionString="host=127.0.0.1;Port=3306;Database=mysql;uid=sa;pwd=12346" providerName="MySql.Data.MySqlClient"/>
</connectionStrings>
文字来源 :原文