Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Help using DataTable and DataGridView
Been reading lots of webpages. Trying lots of things.
The code below retrieves a DataTable or DataSet, but
I can't get the DataGridView to "show" the data.
(GenDB is a separate class with procedures where I
retrieve data from the MS-Access DB.)
What am I missing?
Dim tableSet As DataSet
Dim tableData As DataTable
selectString = "SELECT * FROM BASERECORD"
tableData = GenDB.getDataTable(selectString)
tableSet = GenDB.getDataSet(selectString)
' Populate a new data table and bind it to the BindingSource.
BindingSource1.DataSource = tableData
DataGridView1.DataSource = BindingSource1
' Resize the DataGridView columns to fit the newly loaded content.
Thanks for any help.
0 · ·