如何使用 Windows 身份验证连接字符串使用 OLEDB 连接到 SQL Server
我的 SQL Server 2010 在 Windows 身份验证模式下运行,并且已分配了正确的组。我可以使用 Windows 身份验证通过 SQL Server Client Studio 进行连接。那行得通。但是当使用 .NET OLEDB 连接进行连接时,它失败了,我不明白为什么。
这是字符串:
data source=172.20.0.113;initial catalog=ForgeEnterprise;Integrated Security=SSPI;multipleactiveresultsets=True;App=EntityFramework
这是错误:
Login failed for user 'MOMENTUMI\jmcclure'
我缺少什么吗?
I have SQL Server 2010 running in windows auth mode and the proper groups have been assigned. I can connect via the SQL Server Client Studio using windows auth. That works. But when connecting using .NET OLEDB connections it fails and I can't figure out why.
Here is the string:
data source=172.20.0.113;initial catalog=ForgeEnterprise;Integrated Security=SSPI;multipleactiveresultsets=True;App=EntityFramework
And here is the error:
Login failed for user 'MOMENTUMI\jmcclure'
Is there something I'm missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据 http://connectionstrings.com/sql-server-2008 这应该可以解决问题
其中 Trusted_Connection 显然与 Integrated Security 相同。
如果这不起作用,您应该验证用户是否已添加到数据库的权限选项卡(图片)中,但我想您已经这样做了。
According to http://connectionstrings.com/sql-server-2008 this should do the trick
Where Trusted_Connection is the same as Integrated Security apparently.
If that doesn't work, you should verify that the user is added in the permissions tab (picture) for the database, but I guess you already did that.