Page 1 of 1

How to count in DataTable displayed results from a query?

Posted: Tue 13 Jun 2006 11:16
by communi
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!!

Posted: Tue 13 Jun 2006 11:30
by Serious
You can use MySqlDataTable.Rows.Count property.

Posted: Tue 13 Jun 2006 12:03
by communi
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!

Posted: Tue 13 Jun 2006 13:18
by Alexey
Here you are

Code: Select all

Label1.Text = MySqlDataTable1.Rows.Count.ToString

Posted: Tue 13 Jun 2006 13:32
by Communi
Great! Now it works fine!!! Thank you very much!!!

Posted: Tue 13 Jun 2006 13:40
by Alexey
You are always welcome.