How to find row count in DataGrid using .net compact framework?

How do you find row count in DataGrid using .net compact framework?

+1


source to share


2 answers


Try to query the DataGrid binding context: DataGrid.BindingContext[DataGrid.DataSource].Count



Or, assuming that the data source is a DataTable and you know something about the data source, you can try ((DataTable)dataGrid1.DataSource).Rows.Count

or the equivalent as well.

+4


source


Are you using DataReader with a SQL SQL call? If so, you can use multiple result sets to return the number of rows in your SQL call.

Here is a good example of what I am describing in the link below.



Determine how many DataReader records are about to return

0


source







All Articles