How to count in DataTable displayed results from a query?

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
communi

How to count in DataTable displayed results from a query?

Post by 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!!

Serious

Post by Serious » Tue 13 Jun 2006 11:30

You can use MySqlDataTable.Rows.Count property.

communi

Post by 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!

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by 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.

Communi

Post by Communi » Tue 13 Jun 2006 13:32

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

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Tue 13 Jun 2006 13:40

You are always welcome.

Post Reply