【发布时间】:2012-03-16 14:00:13
【问题描述】:
我正在使用 c# 连接到网络上另一台计算机上的 sql server,但我收到一条异常消息 Login failed for user 'username' 但是服务器日志表明使用 Windows 身份验证的用户连接成功 我的连接字符串是:
"Data Source=ipaddress,1433;Initial Catalog=database;Trusted_Connection=True;Integrated Security=False;Connect Timeout=30;user ID=username;password=password"
我使用的是 microsoft sql server 2008 R2
提前致谢
【问题讨论】:
-
确保您的实例接受远程连接
-
它接受远程连接,我也使用微软管理工作室登录服务器,它工作正常!!
-
你试过了吗:
Persist Security Info=True? -
您正在提供 SQL 凭据并设置
Trusted_connection=true。 stackoverflow.com/questions/1642483/… 的可能重复项
标签: c# .net sql sql-server-2008 connection-string