我在 SQL Server 上创建了一个用户,但使用该登录名时收到以下消息:
Login failed for user ''. The user is not associated with a trusted SQL Server connection.
[SqlException (0x80131904): Login failed for user ''. The user is not associated with a trusted SQL Server connection.]
这是我的连接字符串:
<connectionStrings>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Server=SRV-02;Initial Catalog=OCIS_logins;Integrated Security=True;user id=TEST;password=test" providerName="System.Data.SqlClient"/>
</connectionStrings>
我对这个可能的坏问题感到抱歉,但我通常与 SQL Server 管理员没有任何关系......
希望您能帮助我。
史蒂夫
最佳答案
将此网站添加为书签 http://www.connectionstrings.com它有各种各样的例子
这里是sql server 2005 http://www.connectionstrings.com/sql-server-2005
所以在你的情况下应该是
connectionString="Server=SRV-02;Initial Catalog=OCIS_logins;user id=TEST;password=test" providerName="System.Data.SqlClient"
关于c# - 从 C# Web 应用程序登录 SQL Server 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2258653/