How can I pass new dataset to crystalreports?
I have a problem the new dataset to crystal report viewer in run time.
but I can not figure out what to do because each time I run with new dataset, crystal reports load the old report with old dataset.
What should I do to solve this problem?
My problematic code are;
Dim Ds as dataset
Dim tErr as DataTable
Dim myConn As New OleDbConnection(ConnectionString)
Dim myAdapter As OleDbDataAdapter = New OleDbDataAdapter("Select * From DataTable", myConn)
myConn.Open()
myAdapter.Fill(Ds)
myConn.Close()
tErr = Ds.Tables.Item(0)
Dim myReport = New CrystalReport1
myReport.SetDataSource(tErr)
myReport.load()
CrystalReportViewer1.ReportSource = myReport
I can not figure out what is missing/wrong in above code..
Please help
|