Ladies & Gentlemen,
I have been, thus far, successful in programmatically pulling records from a MySQL database to create a crystal report from a single table. Using the code below, I'm trying to join two tables and display their matched records on the report:
Try
Dim myConnectionString As String = "Server=" & FormLogin.ComboBoxServerIP.SelectedItem & ";Port=3306;Uid=parts;Password=parts;Database=accounting;"
Dim dbConn As New MySqlConnection(myConnectionString)
Dim dbQuery As String = "SELECT * " & _
"FROM cc_master a JOIN customer b ON b.accountNumber = a.customer_accountNumber;"
Dim dbAdapter As New MySqlDataAdapter(dbQuery, dbConn)
Dim dbTable As New DataTable
dbAdapter.Fill(dbTable)
Dim report As New rptCardListAll
report.SetDataSource(dbTable)
CrystalReportViewer1.ReportSource = report
CrystalReportViewer1.Zoom(1)
Catch ex As Exception
'MsgBox(ex.Message)
End Try
The problem I'm running into now is that when the report runs at run-time, all the db records are populated on the report except for the one field that I'm pulling from the CUSTOMER table. Below is a screen shot. Notice the blank CUSTOMER NAME - this shouldn't be blank because I know for a fact there's data in that field for every record.
The query works fine when I run it directly on the DB using MySQL Workbench, so I can't figure out why the report won't pull the requested information. Any help would be appreciated, thanks.
EDIT: Screenshot showing DataSet Visualizer during debug containing the missing field (nameCOMPANY)