无法使用 ConnectionString 连接到远程 Sql 服务器
Cannot Connect To Remote Sql Server With ConnectionString
我正在开发一个需要连接到远程 Sql 服务器的 Winform 项目。
我正在使用 Entity Framework 作为 ORM。这是我的连接字符串
<add name="RemoteConnection" connectionString="Data Source=*****;Initial Catalog=****;User Id=****;Password=*****;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
当我想连接远程 sql 服务器时出现以下错误
Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.
在 SQL Server Management Studio 中一切正常,我能够查看数据库并访问它们,但是在涉及代码时出现错误
User Id=****;Password=*****;Integrated Security=True
错了。如果要使用集成安全性,则不应传递任何凭据(仅保留 Integrated security= True
)。
如果您想使用 SQL 服务器登录名(+ 密码),只传递它们并排除 Integrated security= True
我正在开发一个需要连接到远程 Sql 服务器的 Winform 项目。 我正在使用 Entity Framework 作为 ORM。这是我的连接字符串
<add name="RemoteConnection" connectionString="Data Source=*****;Initial Catalog=****;User Id=****;Password=*****;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
当我想连接远程 sql 服务器时出现以下错误
Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.
在 SQL Server Management Studio 中一切正常,我能够查看数据库并访问它们,但是在涉及代码时出现错误
User Id=****;Password=*****;Integrated Security=True
错了。如果要使用集成安全性,则不应传递任何凭据(仅保留 Integrated security= True
)。
如果您想使用 SQL 服务器登录名(+ 密码),只传递它们并排除 Integrated security= True