• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1305
  • Last Modified:

vb.net 2008 query Datatable and display result into Datagridview

how to query datatable and display result into Datagridview use vb.net 2008 code.
pls provide code.
0
aarontham
Asked:
aarontham
  • 4
  • 3
1 Solution
 
djon2003Commented:
Which database will you be using ? MS SQL ?
0
 
aaronthamAuthor Commented:
hi
i use mysql
0
 
djon2003Commented:
Oh ok ! Than, you will have to choose which Library you will use to connect to the mysql server. I presume you can do one yourself, but there is free ones around.

I've found an example which provide you a good Library and a really good tutorial on how to do what you need : Connecting VB.NET to a MySQL database.

http://www.vbmysql.com/articles/vbnet-mysql-tutorials/the-vbnet-mysql-tutorial-part-3
0
Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

 
aaronthamAuthor Commented:
Hi djon2003,

i already connect to mysql and do query. now i need to query datatable and display result into Datagridview

0
 
djon2003Commented:
Which library do you use to connect to mysql through VB.NET ?

Isn't there a ExecuteQuery or something like method within the MySqlAdapter or MySqlCommand ?
0
 
aaronthamAuthor Commented:
I use MySqlAdapter.
i already have data in dataset. now i need to quiry dataset and display result into datagridview
0
 
djon2003Commented:
A DataSet is usually composed of a property called Tables. If you set the first table (DateSet.Tables(0)) to the DataSource property of your DataGridView, you should see the data within the control.

If your required more personalization about the columns.. You can add those in the DataGridView, but ensure to get all the columns returned by your query. Each column, you have to set the DataPropertyName property which is the ColumnName returned by the query.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now