I'm trying to use the Push method for passing the dataset from a SQL Server stored procedure to Crystal Reports via the aspx. I've tried a dozen different code examples and I keep getting the same dreaded "logon failed" error. Below is the latest code I've tried. Any help would be much appreciated.
Sub BindReporttoDS()
Dim myconnection As New SqlClient.SqlConnection
myconnection.ConnectionString = "myconnstr"
Dim mycmd As New SqlClient.SqlCommand
mycmd.Connection = myconnection
mycmd.CommandType = CommandType.StoredProcedure
mycmd.CommandText = "mysp"
Dim myda As New SqlClient.SqlDataAdapter
myda.SelectCommand = mycmd
Dim myDs As New DataSet
myda.Fill(myDs, "mysp")
Dim oRpt As New CrystalReport1
oRpt.Load()
oRpt.SetDataSource(myDs)
CrystalReportViewer1.ReportSource = oRpt
myconnection.Close()
End Sub
Sub BindReporttoDS()
Dim myconnection As New SqlClient.SqlConnection
myconnection.ConnectionString = "myconnstr"
Dim mycmd As New SqlClient.SqlCommand
mycmd.Connection = myconnection
mycmd.CommandType = CommandType.StoredProcedure
mycmd.CommandText = "mysp"
Dim myda As New SqlClient.SqlDataAdapter
myda.SelectCommand = mycmd
Dim myDs As New DataSet
myda.Fill(myDs, "mysp")
Dim oRpt As New CrystalReport1
oRpt.Load()
oRpt.SetDataSource(myDs)
CrystalReportViewer1.ReportSource = oRpt
myconnection.Close()
End Sub