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


Please Help Members By Posting Answers For Below Questions

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

775


What is ado.net connection?

661


Why do we use sqldataadapter?

695


What do you know about ADO.NET's objects and methods?

716


Do you use stored procedure in ado.net?

758


What is ado.net in vb net?

672


What is the return type of executescalar?

698


How to creating a SqlCommand Object?

794


What is difference between executenonquery and executequery?

680


What is Data Provider?

784


How do you connect to sql server database without using sqlclient?

765


Explain the difference between ado and ado.net?

684


Can datareader hold data from multiple tables?

853


Does sqlclient and oledb class share the same functionality?

704


What is the use of connection object in ado.net?

769