【问题标题】:How do I connect to SQL Server using OLEDB using Windows Authentication connection string如何使用 OLEDB 使用 Windows 身份验证连接字符串连接到 SQL Server
【发布时间】:2011-08-02 14:07:40
【问题描述】:

我在 Windows 身份验证模式下运行 SQL Server 2010,并且已分配正确的组。我可以使用 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'

我有什么遗漏吗?

【问题讨论】:

    标签: sql-server oledb windows-authentication


    【解决方案1】:

    根据http://connectionstrings.com/sql-server-2008,这应该可以解决问题

    Provider=SQLNCLI10;Server=172.20.0.113;Database=ForgeEnterprise;Trusted_Connection=yes;
    

    Trusted_Connection 显然与 Integrated Security 相同。

    如果这不起作用,您应该验证用户是否已添加到数据库的权限选项卡(图片)中,但我猜您已经这样做了。

    【讨论】:

      猜你喜欢
      • 2013-09-07
      • 1970-01-01
      • 2011-04-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-25
      相关资源
      最近更新 更多