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.
aaronthamAsked:
Who is Participating?
 
djon2003Connect With a Mentor Commented:
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
 
djon2003Commented:
Which database will you be using ? MS SQL ?
0
 
aaronthamAuthor Commented:
hi
i use mysql
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.