问题描述
仅在我的SQL Server 2005中配置Windows身份验证.
现在,我试图从我的ASP.Net网站连接一个名为Employee的数据库.
我使用了以下连接字符串
SqlConnection con =新的SqlConnection("server = AVIANI; database = Employee; IntegrategratedSecurity = SSPI");
我收到以下错误:
不支持的关键字:集成安全性".
那么什么是合适的SQLConnection?
如果我需要使用UserId和密码,怎么找到呢?
Windows Authentication is configured only in my SQL Server 2005.
Now I am trying to connect a database named Employee from my ASP.Net web site.
I have used the following connectionstring
SqlConnection con = new SqlConnection("server=AVIANI;database=Employee;IntegrategratedSecurity=SSPI");
I am getting the following error:
Keyword not supported: ''integrategrated security''.
Then What will be the proper SQLConnection?
If I need to use UserId and password,how to find that?
推荐答案
<connectionStrings>
<add name="MyDbConn1"
connectionString="Server=MyServer;Database=MyDb;Trusted_Connection=Yes;"/>
<add name="MyDbConn2"
connectionString="Initial Catalog=MyDb;Data Source=MyServer;Integrated Security=SSPI;"/>
</connectionStrings>
这篇关于Windows身份验证的用户ID和密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!