What is the difference between data reader & data set

Showing Answers 1 - 16 of 16 Answers

DataReader 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.

In DataReader you can not get the no. of records directly from RecordSet.This is similar to VB 6, ForwardOnly RecordSet.

Meanwhile DataSet is disconnected object type.It uses XML to store data

Data reader is much faster then dataset if only selection query is their

Hi All,

Ans:

DataReader

a. Datareader is connection architecture and read and forward-only Data.

b. Datareader reads record one at a time.
c. Datareader is faster then Data Set(During one record at time)


DataSet

a. DataSet is Disconnect architecture ,It store the Data in XML format.
b. DataSet retrive Bluk data at time
c.DataSet Consitency(Means keep data)

  Was this answer useful?  Yes

Data reader:
1) Data Reader is a connected object
2) It contains read only data
3) No updates are allowed
4) It fetches only one record at a time
5) It handles the huge amount of data.

Dataset
1) Dataset is a disconnected object type
2) It fetches all data from the data source at a time
3) Modifications can be updated to the actual database
4) It will reduce the application performance.

  Was this answer useful?  Yes

data reader:
1.It uses the connected architecture.
2.It can be used as Read n forward only
3.Updations are not possible
4.It fectches only one record at a time.
5.It is faster compare to data set.

Data Set:
1.It uses disconnected architecture.
2.It can be used bidirectional n we can update database values by using data set.
3.It fetches all the data from data source at a time
4.It is Collection of more than one table.
5.It is slower

while performance data reader is faster than the data set because data set by default uses the xml scheams.

where to use data set and data reader:

1.if you want to just read the data and no transactions means better to use datareader only.
2.If you have more number of operations(update,insert,delete) and updations batch wise better go for data set.

  Was this answer useful?  Yes

Pendurti

  • Sep 14th, 2008
 

Data Reader

This is Connection oriented and can read only one record at a time. It has got no capability of reading multiple tables at a time. This needs a live connection all the time. 

Data Set
This is connection less and can read more than one table at a time. By making use of data set, we can import the necessary tables from the database onto our client machine, perform necessary modifications on the data and then commit to the server. As it is connectionless, it saves server resources to a greater extent. 

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions