Quote:
quote: posted this issue earlier as well and i was suggested to implement HasRows by simply reading reader.Read() and setting the boolean value.
|
That's not what we suggested. What we suggested was to keep track of a counter (for example) while reading.
Read() always eats a record. So if you use Read to check if there is a record you loose one. However, like this you won't:
bool hasRecords = false;
while (myReader.read())
{
//Do whatever you need to do with myReader here
hasRecords = true;
}
// Here you know whether there are records or not.
Otherwise, like I suggested in my article, check out the data-bound control after data binding.
Why did you move the discussion to this (old) thread? What was wrong with the other discussion?
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of
ASP.NET 2.0 Instant Results and
Beginning Dreamweaver MX / MX 2004