vb.net의 Visual Studio 2008에서 보고서 문서 개체 모델을 사용하여 보고서를 만들었습니다. 하지만 한 가지 오류가 발견되었습니다. 사용자가 클라이언트 측에서 내보내기 버튼을 클릭하면 다음 오류가 표시됩니다. 그러나 사용자가 내보내기 버튼을 클릭하기 전에 처음에는 OK입니다.보고서 문서 개체 모델의 오류
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
어떻게 해결할 수 있습니까? 도와주세요.
내가 있으리라 믿고있어 여기를 참조하십시오 당신이 그것을 작동 위의 자격 증명 표시와 함께 데이터베이스에 직접 연결한다면? – Ben
예, 작동합니다. – zanhtet