Click here to Skip to main content
15,921,542 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
what is the function of reader.HasRows
Posted
Comments
Monjurul Habib 13-Oct-11 17:16pm    
clarify your question..

I got About 39,400 results (0.09 seconds) Enjoy Google
 
Share this answer
 
Comments
Rubaba 3-Dec-11 11:47am    
:) good answer
reader.hasrows

Is a way that you can test if a datareader has rows

further reading SQLdatareader.hasrows[^]
 
Share this answer
 
Comments
Rubaba 3-Dec-11 11:47am    
5* for link
Monjurul Habib 3-Dec-11 13:02pm    
thank you Rubaba.
I've always used it in an if statement something like:

C#
if(!reader.hasrows)
{
label1.text = "Your search found no results"
}

Hope this helps
 
Share this answer
 
reader.hasrows returns bool type
for testing purpose mainly used.whether the datreader contains rows or not

if it returns true means datareader contains rows
if it returns false means datareader has no rows
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900