09-21-2011, 08:19 AM
Join Date: Sep 2011
I need to gather information from 5 different tables.
I am writing to the datasets, but at runtime it does not show any data (an error).
I know the statement is correct as I have done it in a SQL browser.
I am using MySQL to call it and using a dataset to design the crystal report.
I did try calling it within one dataset, but there are more records in some tables than others so it dosen't show true values in the data, this is why I am using 1 tMySQL able to 1 dataset table.
Dim con As MySqlConnection
Dim myReport As New ReportDocument
Dim myData, myDataClient As New DataSet
Dim cmdMySQLData, cmdClient As New MySqlCommand
Dim daData, daClient As New MySqlDataAdapter
Dim proRef As String
Dim cliRef As String
proRef = "PRA50377"
cliRef = "CLA51291"
con = New MySqlConnection()
con.ConnectionString = "Location"
cmdMySQLData.CommandText = "select ref as PROPERTY_ref, address_line1 as PRO_address_line1, address_line2 as PRO_address_line2, address_line3 AS PRO_address_line3, address_line4 AS PRO_address_line4, town as PRO_town, county AS PRO_county, fk_client_sell_ref, postcode AS PRO_postcode FROM tblproperty WHERE ref = '" & proRef & "' "
cmdMySQLData.Connection = con
daData.SelectCommand = cmdMySQLData
cmdClient.CommandText = "SELECT ref, contact_name, no_name, address_line1, address_line2, address_line3, address_line4, town, county, postcode, phone1, phone2, fax, mobile, email FROM tblclient WHERE ref = '" & cliRef & "' "
cmdClient.Connection = con
daClient.SelectCommand = cmdClient
CrystalReportViewer1.ReportSource = myReport '
Catch myerror As MySqlException
Last edited by Flyguy; 09-21-2011 at 09:14 AM.