1

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

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>

它的凭据是正确的。我无法理解为什么会出现该错误。请你们中的任何人为我提供解决方案。

4

1 回答 1

2

确保sa帐户已启用。还要确保SQL Server Authentication已启用以及Windows

在此处输入图像描述

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

打开命令提示符并输入:

sqlcmd –S SQLSERVER\INSTANCE

SQLSERVER\INSTANCE你的SQL盒子在哪里,INSTANCE是那个数据库的实例。

类型:

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

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

于 2013-06-26T07:40:01.783 回答