Integrated Security

来源:互联网 发布:java 设置md5长度 编辑:程序博客网 时间:2024/06/05 17:10

如下一段app.config文件

//该文件用来设置连接数据库字符串

<configuration>
<connectionStrings> 
 
<add name="Pubs" connectionString="Server=localhost;User ID=dot-well;Password=dot-well.com;Integrated Security=True;Database=pubs;" 
  providerName="System.Data.SqlClient" />
</connectionStrings>
解析:
上述有问题

当Integrated Security=false时,将在连接中指定用户ID和密码。
        当Integrated Security=true时,将使用当前的Windows帐户凭据进行身份验证。    
        可识别的值为 true、false、yes、no以及与true等效的sspi.


/"Integrated Security=SSPI/"与/"Trusted_Connection=yes/"相同

建议使用SSPI.