Gets a value that indicates whether the DataTableReader contains one or more rows.
Assembly: System.Data (in System.Data.dll)
The HasRows property returns information about the current result set. If the DataTableReader contains multiple result sets, you can examine the value of the HasRows property immediately after you call the NextResult method in order to determine whether the new result set contains rows.
The following example fills two DataTable instances with data. The first DataTable contains one row, and the second contains no rows. The example then creates a DataTableReader that contains both DataTable objects, and calls the PrintData method to display the contents of each, checking the value of the property of each before it makes the call to PrintData.
Available since 2.0