如何使用Windows身份验证在sqlserver 2008中建立连接字符串?

时间:2011-09-14 08:50:14

标签: sql sql-server-2008

如何使用Windows身份验证在sql server 2008中建立连接字符串?我使用过这段代码:

<add name="EmployeeDatabase" connectionString="Data Source=TVPC0006\SQLEXPRESS;Initial Catalog=EmployeeDatabase;" providerName="System.Data.SqlClient" />

2 个答案:

答案 0 :(得分:2)

您需要拥有的可信连接:

Data Source =myServerAddress; 
Initial Catalog =myDataBase; 
Integrated Security =SSPI;

答案 1 :(得分:1)

查看connectionstrings.com

您需要Integrated Security=SSPITrusted_Connection = True;