Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataReader - How to check for no records returned?

Status
Not open for further replies.

LindaH

Programmer
Dec 12, 2001
42
US
How can I determine whether or not the datareader returned any records?
 
Hey Linda,

I don't use a datareader much (usually datasets/datatables), but is it possible to check the datareaders.length to see how many items are returned, and then handle the datareader from there?

Jack
 
great... i suggest everyone to use datareader if they just want to view the recordsets return... because datasets could drop your system performances very very amazing ^-^

this is how to know whether the datareader return any record :)

SqlDataReader objDataReader = blablabla;
if (objDataReader.Read() == false){
// it means no recordsets returned :)
}

hope this can be of help :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top