Differences between DataSet and DataReader

 Posted by Ddd on 2/10/2011 | Category: ADO.NET Interview questions | Views: 5052 | Points: 40

Differences of DataSet and DataReader:


1)DataSet is always disconnected from the database.

2)DataSet is like a memory resident database.

3)DataSet can contain temporary tables (DataTables), temporary Views(DataViews), temporary primary keys, temporary Foreign keys

4)DataSet supports forward, backward data navigation.

5)DataSets is used to return data from web service methods since it can be serialized.

6)It can be added in a ToolBox

7)Built in XML support.


1)DataReader is connected with database(connected architecture)

2)DataReader is likw a forward only cursor used for reading data.

3)DataReader has no temporary tables, views etc,

4)It supports only forward data navigation.

5)It is not returned from web service method as it cannot be searialized.

6)cannot be added in toolbox

7)No built in XML features.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Muhsinathk on: 6/11/2012 | Points: 10

1.DataSet is the miniature of database in which the datas can be accessed randomly and data manipulations can be carried.
2.DataSet is always a bulky object that requires lot of memory space compare to DataReader.
3.We can do transactions (insert/update/delete) on them and finally the modifications can be updated to the actual database
4.A dataset can allow you access the info on any order at any time.

1. It fetches one row at a time so very less Network Cost compare to DataSet(Fetches all the rows at a time)
2.Only one record in a memmory at a tme.
4.Data reader allows you access the info only one time per item and only in a sequential order

Login to post response