How to count in DataTable displayed results from a query?

How to count in DataTable displayed results from a query?

Postby communi » Tue 13 Jun 2006 11:16

Hello,
in my VB2005 project I have a form with a MySQLDataTable (like in the DataTable sample). How can I count the displayed results of a query so I can make a label on this form like "Query results: xxxxx rows" where xxxx is the count of rows displayed?

Thank you!!
communi
 

Postby Serious » Tue 13 Jun 2006 11:30

You can use MySqlDataTable.Rows.Count property.
Serious
 

Postby communi » Tue 13 Jun 2006 12:03

Can you give me a short sample or code snippet how to use this property? I Couldn't find something about this property in documentation?

Thanks!
communi
 

Postby Alexey » Tue 13 Jun 2006 13:18

Here you are
Code: Select all
Label1.Text = MySqlDataTable1.Rows.Count.ToString
Last edited by Alexey on Tue 13 Jun 2006 13:46, edited 1 time in total.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Postby Communi » Tue 13 Jun 2006 13:32

Great! Now it works fine!!! Thank you very much!!!
Communi
 

Postby Alexey » Tue 13 Jun 2006 13:40

You are always welcome.
Alexey
 
Posts: 2756
Joined: Mon 13 Mar 2006 07:43


Return to dotConnect for MySQL