Using C#
I have a datareader that return a lsit of records from a mysql database.
I am trying to write code that checks if the datareader isnull. The logic
Use dr1.Read() to check that there is a row before attempting to read values. Read gets the first row initially, and then returns subsequent rows, returning true if row available or empty/end of set.
eg.
// for reading one row
if (rd1.Read())
{
// do something with first row
}
// for reading thru multiple rows
while (rd1.Read())
{
// do something with current row
}