GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Microsoft  >  Ado.NET
Go To First  |  Previous Question  |  Next Question 
 Ado.NET  |  Question 10 of 31    Print  
What is the difference between data reader & data set

  
Total Answers and Comments: 6 Last Update: September 15, 2008     Asked by: ratan 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: Ashishtandon.e
 

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



Above answer was rated as good by the following members:
kapilsanchihar
July 05, 2006 04:37:47   #1  
Ashishtandon.e Member Since: March 2006   Contribution: 14    

RE: What is the difference between data reader & data ...

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


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
December 15, 2006 11:31:04   #2  
sbehera02 Member Since: July 2006   Contribution: 18    

RE: What is the difference between data reader & data ...

Datareader is connection mode and read and forward-only Data.

DataSet is Disconnect mode It store the Data in XML format.


 
Is this answer useful? Yes | No
March 29, 2007 12:05:20   #3  
sahu Member Since: December 2005   Contribution: 323    

RE: What is the difference between data reader & data ...
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)


 
Is this answer useful? Yes | No
August 12, 2007 02:25:52   #4  
ramakrishnag1982 Member Since: November 2006   Contribution: 12    

RE: What is the difference between data reader & data ...
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.

 
Is this answer useful? Yes | No
July 10, 2008 07:45:48   #5  
sureshnaspuri Member Since: July 2008   Contribution: 3    

RE: What is the difference between data reader & data set
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.


 
Is this answer useful? Yes | No
September 14, 2008 23:04:05   #6  
Pendurti Member Since: September 2008   Contribution: 10    

RE: What is the difference between data reader & data set
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.

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape