Click here to Skip to main content
15,921,548 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I can go foward with OracleDataReader but
how can go to the first record if I want to do loop again?.

OracleDataReader DataResult;


Thank you.
Willy
Posted

You can't. The documentation[^] states that it's forward-only;

"Provides a way of reading a forward-only stream of data rows from a data source."

Your best alternative is to close the reader and open a new one.
 
Share this answer
 
As has been mentioned a DataReader is forward only, if you need to loop through the same data multiple times you should look at loading the data into a DataSet via a DataAdapter.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900