c# - 从 C# Web 应用程序登录 SQL Server 失败

标签 c# sql sql-server-2005

我在 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/

相关文章:

c# - 我可以将另一个 .net 命名空间中的类公开为我的命名空间中的类吗?

C# Sql CTE Query - 选择额外信息

sql - ORA-32033 : unsupported column aliasing : Oracle 10g

sql-server - 重构 T-SQL 嵌套 SELECT 查询以在 case 语句中使用

sql-server - 连接来自两个不同表的两列

c# - Entity Framework 中映射继承的问题

c# - 获得平均变化的最快算法

python - Django - 使用给定的 sql 转储来创建其他模型并填充数据

android - Android 上使用带空格参数的 SQLite 查询

sql - 获取最多两个条目的查询