I am trying to run a crystal report and I am running into some problems.
I am not sure if I am filling the report correctly or whats. Since my sql statement is not straight out of the box, I think I am calling the wrong information.
Can someone please help me??
Thanks
My code:
Dim MyReport As New LendingTreed 'my crystal report
Dim MyCommand As New SqlCommand
Dim myDA As New SqlDataAdapter
Dim myDS As New Dataset
'''
Dim Connection As New SqlConnection("server=xxx;
database=x
xx;uid=sa;
password=x
xx;")
MyCommand.Connection = Connection
MyCommand.CommandText = "select * " & _
"from northwind..lendingtree lt " & _
"where not exists ( " & _
"Select g.borrow_ssn " & _
"from gen g " & _
"where g.borrow_ssn = lt.ConsumerSSN) " & _
"and lt.status like '%Funded%' " & _
"order by lt.ConsumerSSN "
MyCommand.CommandType = CommandType.Text
myDA.SelectCommand = MyCommand
myDA.Fill(myDS.Tables(0))
MyReport.SetDataSource(myD
S)
CrystalReportViewer1.Repor
tSource = MyReport
Start Free Trial