服務器本地連接:
<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" />