sqlcedatareader - how to detect a zero hit?
Any clues?
kolya
the best/only way to do this is by testing the result from Read().
if (dataReader.Read())
{
//you have rows
}
else
{
//no rows
}
dataReader.Close();
The SqlCeDataReader does not implement the HasRows method.
So aside from testing the results from Read or executing a second count(*) query there is no other way to detect (using the SqlCeDataReader) if the query returned any rows at all.
Thanks.