why datareader is forward only?

why datareader is forward only?


sivaram
Views: 2335 | Community Opinion: 2

Tags..  ASP.NET  ADO.NET  DataReader

Bookmark this page..



Ask a New Question Go to Home

Community Opinion/Answers
 

A DataReader is a stream of data that is returned from a database query. When the query is executed, the first row is returned to the DataReader via the stream. The stream then remains connected to the database, poised to retrieve the next record. The DataReader reads one row at a time from the database and can only move forward, one record at a time. As the DataReader reads the rows from the database, the values of the columns in each row can be read and evaluated, but they cannot be edited.

Generally we use datareader ado.net control where we don't need go to previous row like binding a dropdown or data repeater control. To keep it light weighted microsoft support forward only functionality in datareader control.




sarath babu Said..

data reader contains RECORD SET. due to this data reader read the data in FORWARD and READ ONLY modes. and datareader is a light weight control when compared to dataset.






Register or Login to Post Your Opinion