关于数据连接配置connectionStrings的写法

参考http://www.connectionstrings.com/

1、SQL Server

<add name="ApplicationName" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" 
     providerName="System.Data.SqlClient" /> 
<add name="ApplicationName" connectionString="Data Source=.;Database=Test;User=sa;Password=sa;MultipleActiveResultSets=True" 
     providerName="System.Data.SqlClient"/>

 2、SQL Server Compact

<add name="TestContext" connectionString="Data Source=|DataDirectory|\Test.sdf" providerName="System.Data.SqlServerCe.4.0"/> 
 

3、MySql

<add name="TestContext" connectionString="server=localhost;User Id=root;password=sa;database=test" providerName="MySql.Data.MySqlClient" />
原文地址:https://www.cnblogs.com/shijun/p/2761675.html