Windows 10和Visual Studio 2017集成安全性

时间:2017-07-26 01:06:45

标签: sql-server visual-studio-2017

在Visual Studio中调试并连接到SQL Server时,我以前从未遇到使用集成安全性的问题。

现在使用Windows 10和Visual Studio 2017,当我使用集成安全性尝试连接到SQL Server时,我得到一个异常

System.Data.SqlClient.SqlException: Cannot open database "DataManagement" requested by the login. The login failed. Login failed for user 'MicrosoftAccount\x.x.christopher@gmail.com'.

我在自己的本地计算机上连接到SQL Server。因此,如果我可以在本地使用Windows身份验证连接到SQL服务器。然后,Integrated Security应该选择相同的帐户并使用它。

服务器名称为:DESKTOP-5REGML8\SQLEXPRESS 身份验证确认为:Windows Authentication 用户名:DESKTOP-5REGML8\clark

我的代码中的连接字符串是Data Source=DESKTOP-5REGML8\SQLEXPRESS;Initial Catalog=DataManagement;Integrated Security=True

男孩,这很奇怪,我想通过运行SQL脚本找到了解决方法。但我宁愿确认Integrated Security正在运行。是否有更好的解决方案符合以前版本的Visual Studio / Windows?

0 个答案:

没有答案