Access databases and VB

Moderators: Gogi
Number of threads: 767
Number of posts: 1599

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Help using DataTable and DataGridView Posted by BingoBill on 22 Sept 2011 at 8:06 PM
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.
DataGridView1.AutoResizeColumns( _
DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader)



Thanks for any help.
bill



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.