Logon Fail in Crtystal Report with ASP.Net
Hi all,
I want to create a crystal report using asp.net running on my Local PC... I have add a physical crystal report into my .net project and
can connect to the my local SQL Server - Northwind Database and drag-N-drop the "Customers" Table's fields to the crystal report.
-My setting-
sql server: using sql and window authentication, use "sa" as username and "password" as password.
However, when I run the code, I receive an error message "Logon Failed"... and my code is shown as below:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim crTableLogoninfos As New TableLogOnInfos
Dim crTableLogoninfo As New TableLogOnInfo
Dim crConnectionInfo As ConnectionInfo
Dim crReportDocument As New testRpt
crTableLogoninfos = New TableLogOnInfos
crTableLogoninfo = New TableLogOnInfo
crConnectionInfo = New ConnectionInfo
With crConnectionInfo
.ServerName = "MyComputerName"
.DatabaseName = "NorthWind"
.UserID = "sa"
.Password = "password"
End With
crTableLogoninfo.ConnectionInfo = crConnectionInfo
crTableLogoninfos.Add(crTableLogoninfo)
CrystalReportViewer1.LogOnInfo = crTableLogoninfos
CrystalReportViewer1.ReportSource = crReportDocument
CrystalReportViewer1.DataBind()
End Sub
Anyone have an idea what's wrong ?
Regards,
Charles.
|