Looking for a way to reset or clear a DataReader
-
08-12-2019 - |
Question
Is there an easy way to reset or clear a DataReader so it can be read through more than one time?
I found a Close method but not an open method.
Please show code samples if it can be done.
Solution
A DataReader is created and returned by using a SQL statement or stored procedure. In simple terms the DataReader is basically a cursor in the database data. If you want to use it again, recreate it again.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow