2013-06-26 41 views
1

我在我的網站中使用了Report Viewer。我收到以下錯誤,當我查看報告:登錄失敗錯誤顯示在Microsoft Report Viewer中

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> 

它的憑據是正確的。我無法理解爲什麼我得到這個錯誤。請任何一位爲我提供解決方案。

回答

2

確保sa帳戶已啓用。另外,還要確保SQL Server Authentication啓用以及Windows

enter image description here

首先確保你的連接字符串使用正確的密碼sa。如果你不知道的話,你也可以嘗試通過sqlcmd

打開命令提示符並鍵入重置sa密碼:

sqlcmd –S SQLSERVER\INSTANCE 

哪裏SQLSERVER\INSTANCE是您SQL框和INSTANCE是該數據庫的實例。

類型:

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

嘗試使用新密碼登錄。確保Connection String反映了這一點。

+0

'sa'帳號已啓用且身份驗證模式爲'SQl服務器身份驗證' –

+0

@VamsiPamula - 您可以通過管理工作室登錄嗎?使用'sa'帳戶或任何其他帳戶? –

+0

我只使用'sa'帳戶登錄 –