Difference between DataSet and DataReader?

ADO.NET has two major objects for Data Fetching, DataSet and DataReader. What is the Difference between DataSet and DataReader? In which scenario you will prefer DataSet?

Nirmal Sinha
Views: 16282 | Community Opinion: 20

Tags..  ASP.Net Interview  ADO.NET  DataSet  DataReader  .Net Framework

Bookmark this page..



Ask a New Question Go to Home

Community Opinion/Answers
 
Parkash Said..

Comparison of DataSet and DataReader objects (DataSet vs DataReader)

DataSet is a disconnected architecture, while DataReader has live connection while reading data. If we want to cache data and pass to a different tier DataSet forms the best choice and it has decent XML support.

When application needs to access data from more than one table DataSet forms the best choice.

If we need to move back while reading records, datareader does not support this functionality.

One of the biggest drawbacks of DataSet is speed. As DataSet carry considerable overhead because of relations, multiple tables etc speed is slower than DataReader. Always try to use DataReader wherever possible, as it’s meant specially for speed performance.




Virendra I. Yadav Said..

As i am fresher for this question so i do not have any comment




Praveen Said..

This is correct answer in my point view.




kishore Said..

its good but need more information




Amit Said..

Yes




Amit Tiwari From DigiSoft Said..

this is right ans but i think u should provided more information then it




Vivek Jain Said..

i have some more points to include right here:

1- Dataset is heavy weight while DataReader is light weight.
2- Dataset is non persistence while DataReader is persistence.




amit.chandra Said..

Yes, the ans is right.




ebus Said..

good uses full thanks...........




vivek k Said..

DataReader:If you want to display the records from more than one table and the size of the data is more rather than standerd size, then you can go with datareader. Datareader is allow you to read the data but you can not update.
DataSet:If you have a low number of table and data with frequently using then you go for it.




Gaurav Agrawal Said..

For suitable answer go to this URL
http://intquesans.blogspot.com/2011/05/difference-between-dataset-and.html




Gaurav Agrawal Said..

http://intquesans.blogspot.com/2011/05/difference-between-dataset-and.html
this moved to
http://planetofcoders.blogspot.com/2011/06/difference-between-dataset-and.html




santhiya Said..

Data set is read/write access and data reader is read only access




programmings Said..

This is good answer all points are right......i was searching this question long time....i got find more valuable answer from
www.cprogrammings.com of following link........
http://www.cprogrammings.com/result/Difference-between-DataSet-and-DataReader/43.html




Patriots Jerseys Said..

cheap Pittsburgh Steelers Jerseys were established in 1946. The official team colors of the Pittsburgh Steelers Jerseys uniforms are Brown, Orange, White. The Steelers Women Jerseys online NFL Shop offers Custom Steelers Jerseys fan gear for women, Throwback Steelers Jerseys apparel for men, Other Jerseys gear for youth and Green Bay Packers. Our latest apparel range consists of Chicago Bears jerseys Browns jerseys, Baltimore Ravens jerseys, Browns tailgating, cheap Buffalo Bills jerseysapparel and more clothing and fan merchandise. Exclusive Detroit Lions jerseys and gear from Reebok, Mitchell & Ness and http://www.steelersjerseyscheap.com/other/indianapolis-colts-jerseys.html coupled with Atlanta Falcons jerseys online discounts and fast shipping make the Houston Texans jerseys online store of the Arizona Cardinals jerseys your ideal source for Cleveland Browns Carolina Panthers jerseys and merchandise. Cincinnati Bengals jerseys have the largest selection of Cleveland Browns jerseys products on the Internet! Unemployment in Dallas Cowboys jerseys has climbed to a new record high - there are now 1,530 Denver Broncos Jerseys registered as looking for Kansas City Chiefs jerseys, but the number of young jobless Jacksonville Jaguars jerseys fallen. This latest Miami Dolphins jerseys total is 30 higher than a month ago, 220 higher than a http://www.nfljerseyspatriots.com/new-england-patriots-jerseys.html ago and 440 higher than two Chad Ochocinco Jerseys ago.Long-term unemployment - Tom Brady jerseys for more than a year - now accounts for Wes Welker jerseys than one in six job hunters. That New England Patriots Jerseys has doubled in a Patriots Women Jerseys.There is brighter news for young people aged 16 to 19. Custom Patriots Jerseys were 260 in the job queue - the Throwback Patriots Jerseys in that age band for 18 months - and Other




nfl jerseys Said..

Tom McGrath, vice president and program manager (supply NHL jerseys)for Lockheed Martin's THAAD program, said in a statement released in Dallas that it was the first foreign military sale of the THAAD system. THAAD interceptors are produced at Lockheed Martin's Pike County Facility in Troy, Ala. The launchers and fire control units are produced at(supply Boston Bruins JERSEYS) the company's Camden, Ark., facility. Wary of Iran, the U.S. has been building up missile defenses of its allies, including a $1.7 billion deal to upgrade Saudi Arabia's Patriot missiles and the sale of 209 Patriot missiles to Kuwait, valued at about $900 million(WHOLESALE GREEN PACKERS JERSEYS). On Thursday, the Obama administration announced the(supply NEY YORK RANGERS JERSEYS)sale of $30 billion worth of F-15SA fighter jets to Saudi Arabia. Under the fighter jet agreement, the U.S. will send Saudi Arabia 84 new fighter jets and upgrades for 70 more. Production of the aircraft, which will be manufactured by Boeing Co., will support 50,000 jobs (supply NHL jerseysand have a $3.5 billion annual economic impact in the U.S.




Ankit Gupta Said..

1) A DataReader works in a connected environment, whereas DataSet works in a disconnected environment.

2) A DataReader object represents a forward only, read only access to data from a source. It implements IDataReader & IDataRecord interfaces.
A DataSet represents an in-memory cache of data consisting of any number of inter-related DataTable objects. A DataTable object represents a tabular block of in-memory data. Further, a DataRow represents a single row of a DataTable object. A Dataset is like a mini-database engine




foxin Said..

moncler vendita 1994 outdoor sports apparel since the door is opened, they were wearing more and more in more places. From 94 to 98 years Piumini Moncler Become the European region and the world's most famous retailers, only in Italy, Japan, Germany, Australia, Switzerland, United Kingdom, Sweden, Norway, Denmark or exercise those boutiques to buy Moncler boutiques known for something. But what really makes the brand or to re-count in 1998 under the pepper industry last FinPart Group initiatives. Continuation of the previous strategic restructuring plan, in support of head office FinPart Moncler to develop more product lines, give full play to the potential value of the brand. The TV ads that appear born in the mountains, living in the city's image has become a classic. Moncler's padded jacket as the cold season, when skiing or in the elegant occasions recognized the essential Moncler Outlet




pavan Said..

1) A DataReader works in a connected environment, whereas DataSet works in a disconnected environment.

2) A DataReader object represents a forward only, read only access to data from a source. It implements IDataReader & IDataRecord interfaces.
A DataSet represents an in-memory cache of data consisting of any number of inter-related DataTable objects. A DataTable object represents a tabular block of in-memory data. Further, a DataRow represents a single row of a DataTable object. A Dataset is like a mini-database engine




Mahesh Said..

Re Dont give same answers

MR pavan

1) A DataReader works in a connected environment, whereas DataSet works in a disconnected environment.

2) A DataReader object represents a forward only, read only access to data from a source. It implements IDataReader & IDataRecord interfaces.
A DataSet represents an in-memory cache of data consisting of any number of inter-related DataTable objects. A DataTable object represents a tabular block of in-memory data. Further, a DataRow represents a single row of a DataTable object. A Dataset is like a mini-database engine






What do you think? Add your opinion/answer
*Name
*your opinion/answer: