Make DbDataReader start reading again from the beginning of the result set
You can't.
The *DataReader
classes are forward-only iterators.
Instead, you can store the results in a List<T>
(or a DataTable
)
You can do that by first closing the datareader using dr.close();
then initializing it again.
If(condition)
{
dr.close();
dr=command.ExecuteReader();
}
Where command is the MySqlCommand
object.
The only way to restart it is to grab a new reader with ExecuteReader()
.