我使用带有 vb.net 的 Visual Studio 2008 中的报表文档对象模型创建了一个报表。但是我发现了一个错误。当用户在客户端单击导出按钮时,将显示以下错误。但是在用户单击导出按钮之前,第一次是可以的。
Logon failed. Details: ADO Error Code: 0x Source: Microsoft OLE DB Provider for SQL Server Description: Login failed for user 'zanhtet'. SQL State: 42000 Native Error:
这是调用报告代码。
Dim ReportDocument As New ReportDocument()
Dim ReportPath As String = Server.MapPath("~/ReportDocumentOM/DBlogInRDOM.rpt")
ReportDocument.Load(ReportPath)
ReportViewer.ReportSource = ReportDocument
Dim ConnectionInfo As New ConnectionInfo
ConnectionInfo.ServerName = "ZANHTET\SQLEXPRESS"
ConnectionInfo.DatabaseName = "EAS_DevTrack4UDev"
ConnectionInfo.UserID = "zanhtet"
ConnectionInfo.Password = "123456"
For Each Table As Table In ReportDocument.Database.Tables
Dim TableLogOn As TableLogOnInfo = Table.LogOnInfo
TableLogOn.ConnectionInfo = ConnectionInfo
Table.ApplyLogOnInfo(TableLogOn)
Next
我该如何解决这个问题。请帮我。