HasRows property

S

stefano mostarda

The property exists. It is included in the datareader object.

Best Regards.
Stefano Mostarda
Rome Italy
 
T

Teemu Keiski

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top