HasRows property

  • Thread starter Thread starter Stijn Verrept
  • Start date Start date
The property exists. It is included in the datareader object.

Best Regards.
Stefano Mostarda
Rome Italy
 
Yes, there is such property but as was said in the reply, it addresses the
problem but doesn't remove it e.g you still need to do the check,.

You could have a check like this:

If sqlDataReader.HasRows Then
DataGrid1.DataSource = sqlDataReader
DataGrid1.DataBind()
Else
Label1.Text = "No records found"
End If
 
Back
Top