[英]How do I connect to SQL Server using OLEDB using Windows Authentication connection string
I have SQL Server 2010 running in windows auth mode and the proper groups have been assigned. 我有在Windows身份验证模式下运行的SQL Server 2010,并且已分配了适当的组。 I can connect via the SQL Server Client Studio using windows auth. 我可以使用Windows身份验证通过SQL Server Client Studio连接。 That works. 这样可行。 But when connecting using .NET OLEDB connections it fails and I can't figure out why. 但是,当使用.NET OLEDB连接进行连接时,它将失败,我无法弄清原因。
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? 有什么我想念的吗?
According to http://connectionstrings.com/sql-server-2008 this should do the trick 根据http://connectionstrings.com/sql-server-2008,这应该可以解决问题
Provider=SQLNCLI10;Server=172.20.0.113;Database=ForgeEnterprise;Trusted_Connection=yes;
Where Trusted_Connection is the same as Integrated Security apparently. 其中,Trusted_Connection与集成安全性显然相同。
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. 如果这不起作用,则应验证是否已在数据库的“权限”选项卡(图片)中添加了该用户,但我想您已经这样做了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.