Hi there,
I am just trying to populate crystal report with customers data from
Northwind database. The below is the code.
It doesn't return any error and i can see the report in the front but
the report is empty. It doesn't have the data in it. i am i missing
some thing here?
Please help thanks
-L
**********************************
code********************************************** ***********
Dim rpt As New CrystalReport1
Dim myConnection As SqlConnection
Dim MyCommand As New SqlCommand
Dim myDA As New SqlDataAdapter
Dim myDS As New Dataset1
Try
myConnection = New SqlConnection("Data
Source=localhost;Integrated Security=SSPI;" & _
"Initial
Catalog=northwind;")
MyCommand.Connection = myConnection
MyCommand.CommandText = "SELECT * FROM Customers"
MyCommand.CommandType = CommandType.Text
myDA.SelectCommand = MyCommand
myDA.Fill(myDS, "Customers")
rpt.SetDataSource(myDS)
CrystalReportViewer1.ReportSource = rpt
Catch Excep As Exception
MessageBox.Show(Excep.Message, "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
**************************************** end of the code
******************************************