Columns Missing
Using the following codes, I try to add a datasource. It gets added, but non of the columns/fields are listed. If I click on the table to edit it, don't change anything, just step through the wizard.....when I click finish, the fields/columns show up. Is there a way I can automatically populate the columns in the datasource?
Dim conn As New FastReport.Data.MsSqlDataConnection
conn.Name = "Current Sales Ticket"
conn.ConnectionString = varConnect
Report1.Dictionary.Connections.Add(conn)
Dim table As New TableDataSource()
table.TableName = "Payment Details"
table.Name = "Payment Fields"
table.SelectCommand = "SELECT paymentAmount,paymentData1,paymentData2,paymentTitle FROM [dbo].[tbl_invoicePayments] INNER JOIN tbl_invoicePaymentTypes ON paymentType= tbl_invoicePaymentTypes.paymentID"
conn.Tables.Add(table)
Dim conn As New FastReport.Data.MsSqlDataConnection
conn.Name = "Current Sales Ticket"
conn.ConnectionString = varConnect
Report1.Dictionary.Connections.Add(conn)
Dim table As New TableDataSource()
table.TableName = "Payment Details"
table.Name = "Payment Fields"
table.SelectCommand = "SELECT paymentAmount,paymentData1,paymentData2,paymentTitle FROM [dbo].[tbl_invoicePayments] INNER JOIN tbl_invoicePaymentTypes ON paymentType= tbl_invoicePaymentTypes.paymentID"
conn.Tables.Add(table)
Comments
Try to call the RefreshTable() method of TableDataSource.
Thanks, this did the trick.