服务器本地连接:
<connectionStrings> <add name="db" connectionString="Data Source=localhost;Integrated Security = true ; Initial Catalog = sy_sitesys" providerName="System.Data.SqlClient" /> </connectionStrings>
数据库名称为:sy_sitesys,使用Windows身份验证方式
使用SQL Server 身份验证方式:
<add name="db" connectionString="Data Source=localhost;Initial Catalog=mydb;User ID=sa;Password=sa;MultipleActiveResultSets=true" providerName="System.Data.SqlClient" />