登录失败错误显示在Microsoft Report Viewer中

时间:2013-06-26 07:36:55

标签: c# asp.net sql .net reportviewer

我在我的网站上使用报告查看器。当我查看该报告时,我收到以下错误:

An error has occurred during report processing.
    Exception has been thrown by the target of an invocation.
        Login failed for user 'sa'.

我已将web.config文件中的连接字符串指定为

<connectionStrings>
 <add name="TPSConnectionString" connectionString="Persist Security Info=False;User ID=sa;Password=***********;Initial Catalog=DataBaseName;Data Source=MyDataSource" providerName="System.Data.SqlClient"/>
 </connectionStrings>

它的凭据是正确的。我无法理解为什么我会收到这个错误。请你们中的任何一个人为我提供解决方案。

1 个答案:

答案 0 :(得分:2)

确保已启用sa帐户。另外,请确保SQL Server Authentication以及Windows

已启用

enter image description here

首先确保您的连接字符串使用正确的sa密码。如果您不知道,也可以尝试通过sa重置sqlcmd密码

打开命令提示符并键入:

sqlcmd –S SQLSERVER\INSTANCE

其中SQLSERVER\INSTANCESQL框,INSTANCE是该数据库的实例。

类型:

sp_password @new = ’newpassword’, @loginame = ‘sa’
GO
EXIT

尝试使用新密码登录。确保Connection String反映了这一点。

相关问题