Difference between datareader and dataset?
Answer Posted / yasir a. mughal
 DataReader (Connection Oriented) is a forward only and
read only data while DataSet (Disconnected) is used to
maintain relationships between multiple tables.
 You can access one table at a time while it is define with
multiple tables.
 DataReader can't persists the data while DataSet can
persist the data
 DataReader operation is faster than DataSet operation.
 DataReader is connection oriented you can find the changes
in the database reflected in data reader immediately, where
as DataSet is pure disconnected one you will find the
changes only when you refresh the dataset using DataAdapter.
but conclusion....
Another often cited issue knows when to use DataReader as
opposed to DataSet objects. As a rule, if you don't need the
data once it has been read then uses a DataReader. The
DataReader offers a forward-only trip through data, whereas
DataSet allows you access to a group of data that may be
necessary to populate an ASP.NET Repeater or similar control.
| Is This Answer Correct ? | 3 Yes | 5 No |
Post New Answer View All Answers
What is aggregating data ?
Can we connect two dataadapters to same data source using single connection at same time?
What are dcl commands?
What is dataadapter in ado.net?
how you will deal result set? How do you sort a dataset?If a dataset contains 100 rows, how to fetch rows between 5 and 15 only?
What is a dataview?
What is an ado?
What are the different methods by which we can populate a dataset?
If a table contains 20000 records. In a page at each time 100 records to be displayed.
How can we save all data from dataset?
Is entity framework better than ado.net?
What is aggregate root?
how Sequence to connect and retrieve data from database using dataset?
Define Execute Reader?
If we are not returning any records from the database, which method is to be used?