Difference between datareader and dataset?

Answers were Sorted based on User's Feedback



Difference between datareader and dataset?..

Answer / sudheendra

DataReader
Datareader is like a forward only recordset. It fetches one
row at a time so very less Network Cost compare to
DataSet(Fetches all the rows at a time). DataReader is
readonly so we cannot do any transaction on them. DataReader
will be the best choice where we need to show the data to
the user which requires no transaction ie reports. Due to
DataReader is forward only we cannot fetch the data
randomly. .NET Dataproviders optimizes the datareaders to
handle the huge amount of data.

DataSet
DataSet is always a bulky object that requires lot of memory
space compare to DataReader. We can say the dataset as a
small database coz it stores the schema and data in the
application memory area. DataSet fetches all data from the
datasource at a time to its memory area. So we can traverse
through the object to get required data like qureying database.

The dataset maintains the relationships among the datatables
inside
it. We can manipulate the realational data as XML using
dataset.We can do transactions (insert/update/delete) on
them and finally the modifications can be updated to the
actual database. This provides impressive flexibility to the
application but with the cost of memory space. DataSet
maintains the original data and the modified data seperately
which requires more memory space. If the amount of data in
the dataset is huge
then it will reduce the applications performance dramatically.

The following points will improve the performane of a dataset...

1. Don't use the commandbuilder to generate the sql statements.
Though it reduces the development time the query generated

by the command builder will not be always as required. For
example
To update the details of an author table the command

Is This Answer Correct ?    3 Yes 3 No

Difference between datareader and dataset?..

Answer / harshan kadam

Data reader is the forward and read only .it is a
disconnected architecture of the data base.it is the works
on retrive the data on the data base.

DataSet is the disconnected architecture.it is a works on a
data base is x-copy and retrive the data.it is a collection
of data collection(data row and data column) and is the
connection of the XML.

Is This Answer Correct ?    1 Yes 1 No

Difference between datareader and dataset?..

Answer / 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

Difference between datareader and dataset?..

Answer / salahuddin ahmed

Datareader operation is faster than dataset operation.

Datareader is connected to the data source whereas dataset
is connected to the XML.

Is This Answer Correct ?    40 Yes 43 No

Difference between datareader and dataset?..

Answer / unknow

Examples:
Data Reader:BK Sir
DataSet:Mahavir Sir

Is This Answer Correct ?    6 Yes 16 No

Difference between datareader and dataset?..

Answer / suganya

Using Data Reader only one value can be accessed from the
database whereas using Dataset you can access a any number
of values from the database.

Is This Answer Correct ?    55 Yes 69 No

Post New Answer

More ADO.NET Interview Questions

what is trigger?

8 Answers   Microsoft, Precept Technology,


What is maximum pool size in ado.net connection string?

0 Answers  


What is the maximum pool size in ado.net connection string?

0 Answers  


What Is Difference Between Ado And Ado.net?

0 Answers   BirlaSoft,


What are the various methods provided by the DataSet object to generate XML?

0 Answers  






how can implement dropdownlist in particular of dataset when try to update?

0 Answers   TCS,


What is an orm, and why would you use one instead of plain old ado.net?

0 Answers  


What providers do you use to connect to oracle database ?

4 Answers   Digital GlobalSoft,


How to sort the data in Datatable

2 Answers   NetProphet,


Is bulk insert faster than insert?

0 Answers  


Explain About ado.net components/objects. Usage of data adapters and tell the steps to retrieve data.

0 Answers  


What is the difference between sqldatareader and sqldataadapter?

0 Answers  


Categories