Interviews6 answers
Difference between DataReader and DataSet ?

Jeetendra Gund
Posted Mar 27, 2014, 1:52 AM EDT6 Answers
Data Set
1)Data Set is Disconnected architecture .
2)In data set we can hold multiple table values at a time.
3)We can traverse forward -backward in Data Set.
4)We can Read as well as Edit values in Data Set.
5)In terms of speed data set is slow
Data Reader
1) Data Reader is connected architecture.
2)Data reader holds single value at a time.
3)In data reader only forward traversing is possible.
4)In data Reader we can only read data.
5)In terms of speed Data Set is faster.
Roymon TPPosted Oct 6, 2014, 9:36 AM EDT
We Can Only Access Data from DataReader. it is forward only navigation. it is faster in access due to disconnected architecture.
DataSet is Connected Architecture. It is forward and Backward Navigation. It returns Multiple Tables
Mahesh Kumar AlankaPosted Apr 25, 2014, 9:55 PM EDT
http://www.aspdotnet-suresh.com/2012/10/aspnet-difference-between-datareader.html
http://www.codeproject.com/Articles/420217/DataSet-vs-DataReader
Khan Abrar AhmedPosted Apr 6, 2014, 3:54 AM EDT
The difference b/w Data Set and Data Reader
(1):-Data Reader provides forward only and read only access to data, while the Data set objects can hold more than one table from the same data source as well as the relationships between them.
(2):-Dataset is a disconnected architecture while data reader is connected architecture.
(3):-Dataset can persist contents while data reader cannot persist contents they are forward only.
Munesh SharmaPosted Apr 4, 2014, 2:04 AM EDT
http://www.c-sharpcorner.com/Blogs/12509/difference-between-datareader-dataset-dataadapter-and-data.aspx
DhinakaranPosted Apr 1, 2014, 9:10 PM EDT
DataSet:-
We should use when the application is:
· Windows application
· Not too large data
· Returning multiple tables
· If, to be serialized
· Disconnected architecture
· To return from a WCF service
· To send across layers
· Caching the data
· Do not need to open or close connection
DataReader
DataReader is a stream which is readonly and forward only. It fetches the record from databse and stores in the network buffer and gives whenever requests. DataReader releasese the records as query executes and do not wait for the entire query to execute. Therefore it is very fast as compare to the dataset. It releases only when read method is called.
Its usages:
· Web application
· Large data
· Returning multiple tables
· For Fast data access
· Needs explicitly closed
· Output parameter value will only available after close
· Returns only a row after read
Anurag SarkarPosted Mar 28, 2014, 12:02 AM EDT




