Tuesday, 10 December 2013

Dataset vs DataReader

ADO.NET Dataset vs DataReader


DataSet and DataReader are called fundamental objects of ADO.net as they are used to store data and make it available for .net application and they have the following differences.

Differences Between DataSet and DataReader


DataSet
DataReader


It  is  disconnected  object  and  can  provide
It is connected object and can not provide
access  to  data  even  when  connection  to
access to data when connection to database
database was closed.
was closed.


It can store data from multiple tables
It can store data from only one table.


It allows insert, update and delete on data
It  is  read  only  and  it  doesn’t  allow  insert,

update and delete on data.


It  allows  navigation  between  record  either
It  allows  only  forward  navigation  that  also
forward or backward.
only to immediate next record.


It can contain multiple records.
It can contain only one record at a time.


All  the  data  of  a  dataset  will  be  on  client
All  the  data  of  a  DataReader  will  be  on
system.
server and one record at a time is retrieved

and stored in datareader when you call the

Read() method of datareader.



No comments:

Post a Comment