Why DataReader is Forward Only?

Answers were Sorted based on User's Feedback



Why DataReader is Forward Only?..

Answer / vrushali

DataReaader is connected object and one can process the
rows that are returned by query, one at a time. It discards
every row after you have gone through it and so it is
extremely fast.It contains only read-only data, so no
updates are allowed using DataReader
objects.

Is This Answer Correct ?    51 Yes 3 No

Why DataReader is Forward Only?..

Answer / lovely

Data Reader worked as conventional Record Set of VB
and
Data Reader worked in connected mode only

Is This Answer Correct ?    52 Yes 13 No

Why DataReader is Forward Only?..

Answer / sachin gupta

Because it inherit DbDataReader Abstract Class and
DbDataReader Abstract Inherit the IEnumerable and its give
GetEnumerator(Returns an enumerator that iterates through a
collection.)its Type IEnumerator and IEnumerator gives
MoveNext() Method so Datareader is Forward only.

Is This Answer Correct ?    25 Yes 1 No

Why DataReader is Forward Only?..

Answer / guneetinder singh

because it satisfy read only property from which we can only
retrieve data only(forword) not write to int(backword).

Is This Answer Correct ?    29 Yes 7 No

Why DataReader is Forward Only?..

Answer / rahul singhal

datareader execute data from table one by one at each
calling of it.and to fetch next value from database it
contains pointer value(index) of next value . thats why if
is forward only. in the oops concept it works on the concept
of one-way linklist

Is This Answer Correct ?    23 Yes 2 No

Why DataReader is Forward Only?..

Answer / manumole

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.

Is This Answer Correct ?    19 Yes 2 No

Why DataReader is Forward Only?..

Answer / nevin jain

from all 11 above answer only Sachin Gupta have given write
answer...
becoz SqlDataReader inherit DbDataReader whose base type is
IEnumerable that use to access collection through simple
iteration which is forward only manner...

Basically SqlDataReader Class access records n retrieve them
as collection through simple iteration...

to make more clear first read Functionality of IEnumerable
interface that expose GetEnumerator() method...

Is This Answer Correct ?    6 Yes 1 No

Why DataReader is Forward Only?..

Answer / sandyni

As we know that DataReader is connected architecture it
cannot persists the contents. it reads the contents one by
one record from the dataset until all the records completed.

The main thing is data reader uses pointers to fetch the
next record(index).hence these are the forward only objects

Is This Answer Correct ?    6 Yes 4 No

Why DataReader is Forward Only?..

Answer / sanchit yadav

Because it inherites the IEnumerable.IEnumarble contains
the method(getenumerator) its type is IEnumerator it
returns the instance of IEnumerator that implements in a
class that contains three methods current(),movenext(),
reset().Ist call the current() than movenext() move first
tuple to last tuple in the table than call reset() than
cursor moves on the current().So,DataReader works in
forward only and Read only manner.

Is This Answer Correct ?    1 Yes 0 No

Why DataReader is Forward Only?..

Answer / srikanth r

To support faster data access in the connected environment.

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More ADO.NET Interview Questions

What is difference between executequery and executeupdate?

0 Answers  


How to work with disconnected data - the dataset and sqldataadapter?

0 Answers  


can anybody show me the structure of ADO.NET

1 Answers  


i making a project using windows application c#, i want to show user name, password, and one button login. i wanna make it with sealed class .how its possible . when i clicked my login button all project should be open. pls cleare me.

1 Answers  


What is the difference between data reader and data adapter?

0 Answers  


can we have multiple datatables in a datareader ?

18 Answers   Fulcrum Logic, Infosys, Kale Consultants, Ness Technologies,


What are the various methods provided by the DataSet object to generate XML?

0 Answers  


What are two types of transaction supported by ado.net?

0 Answers  


Where is adodb dll located?

0 Answers  


Explain the differences between oledb sql server, oledbdotnet provider?

0 Answers  


What are the advantages of oledb compared with other classes?

0 Answers  


What do you mean by performing asynchronous operation using command object?

0 Answers  


Categories