Difference between datareader and dataset?

Answers were Sorted based on User's Feedback



Difference between datareader and dataset?..

Answer / chaitanya.k

Data Reader is a forward only and read only data
DataSet is used to maintain relationships between multiple
tables.

Data Reader can't persist the data
Data Set can persist the data

Is This Answer Correct ?    145 Yes 22 No

Difference between datareader and dataset?..

Answer / chaitanya k

Data reader
1. It is a read only and forward only data.
2. U can access one table at time.
3. It can't persist the data.
4. It is comes under connected architecture.
5. One of the most advantage is it is much faster than data
adapter

Data set:

1. It is defined with multiple tables.
2. It can persist the data.
3. It is a relational data cache hosted in application
domain during execution.
4. It is a disconnected architecture.
5. It can't defined with out data adapter.

Is This Answer Correct ?    121 Yes 12 No

Difference between datareader and dataset?..

Answer / ganesh

datareader(connection oriented) is a read only and forward
only record set which will have the data retrieved based on
the select statement.we can't do DML operations through
datareader.

whereas dataset(disconnected) model which we can do all the
DML operations.

Is This Answer Correct ?    111 Yes 20 No

Difference between datareader and dataset?..

Answer / raghavendra.v

DataReader is conncetion oriented u 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 u refresh the dataset using dataadapter

Is This Answer Correct ?    50 Yes 13 No

Difference between datareader and dataset?..

Answer / madhavi

DATA Reader
The DataReader has a defined set of operations that revolve
around its connected, forward-only, read-only nature (the
read-only DataReader is also known as the firehose cursor of
ADO.NET). A DataReader is a stream of data that is returned
from a database query. When the query is executed, the first
row is returned to the DataReader via the stream. The stream
then remains connected to the database, poised to retrieve
the next record. The DataReader reads one row at a time from
the database and can only move forward, one record at a
time. As the DataReader reads the rows from the database,
the values of the columns in each row can be read and
evaluated, but they cannot be edited.

DATA Adapter
The DataSet is the main data storage tool in the ADO.NET
disconnected architecture. Unlike the DataReader, the
DataSet is not connected directly to a database through a
Connection object when you populate it. Instead, to fill a
DataSet from a database you first create a DataAdapter
object (such as a SqlDataAdapter) for the provider and
associate it with a SqlConnection object. Then the
SqlDataAdapter can broker the data retrieval for the DataSet
by issuing a SqlCommand against the database through the
SqlConnection, retrieving the data, and filling the DataSet.

You can think of the SqlDataAdapter as a bridge between the
connected and disconnected objects. One of its purposes is
to serve as the route for a rowset to get from the database
to the DataSet. For example, when the SqlDataAdapter's Fill
method is executed it opens its associated SqlConnection
object (if not already open) and issues its associated
SqlCommand object against the SqlConnection. Behind the
scenes, a SqlDataReader is created implicitly and the rowset
is retrieved one row at a time in succession and sent to the
DataSet. Once all of the data is in the DataSet, the
implicit SqlDataReader is destroyed and the SqlConnection is
closed.

Is This Answer Correct ?    40 Yes 10 No

Difference between datareader and dataset?..

Answer / bhupi

Data reader:it is a connection .in which we can forward the
data in only read only form,directly to the .net
application may be web or windows

Dataset: data set is the very similer to the to the Data
base ,we can say it is a duplicate copy of our original
data base ,all tha query are executed on the data set and
after that changes are made in original database

Is This Answer Correct ?    36 Yes 7 No

Difference between datareader and dataset?..

Answer / anju

- Data reader is a connection oriented architecture as its
requires continues connection with Data base.
while Data set is disconnected oriented architecture,
whenever user wants to pull the data he/she build the
connection with Data base.


-Data readers execution is very fast. as it reads only
forward stream.
while
Data set execution is slow as compare to Data reader, as it
carries bundle of data.


- when data changes requires frequently then User should go
for Data set, when user doesn't require data changes
frequently then he/ should go for Data Reader.

Is This Answer Correct ?    14 Yes 6 No

Difference between datareader and dataset?..

Answer / kailash urmliya

Dataset is a Part of Disconnected Architecture .
Dataset can Store Multiple Tables
Dataset can Persist Data and DataReader Can't Persist Data

Is This Answer Correct ?    5 Yes 0 No

Difference between datareader and dataset?..

Answer / sridhar.m

Data reader
1. It is a read only and forward only data.
2. U can access one table at time.
3. It can't persist the data.
4. It is comes under connected architecture.
5. One of the most advantage is it is much faster than data
adapter
6.datareader connection oriented.

Data set:

1. It is defined with multiple tables.
2. It can persist the data.
3. It is a relational data cache hosted in application
domain during execution.
4. It is a disconnected architecture.
5. It can't defined with out data adapter.
6.whereas dataset disconnected.

Is This Answer Correct ?    5 Yes 1 No

Difference between datareader and dataset?..

Answer / sumanth

Data Reader:A class used to efficiently process a large list
of results one record at a time.

Data Set:A Data Set object represents a schema (either an
entire database or a subset of one). It can contain tables
and relationships between those tables.

Is This Answer Correct ?    4 Yes 0 No

Post New Answer

More ADO.NET Interview Questions

Why is ADO.NET serialization slower than ADO ?

0 Answers   NA,


What is the full form of ado?

0 Answers  


How you will set the datarelation between two columns?

3 Answers  


How do you merge two datasets into the third dataset in a simple manner?

3 Answers   IBM,


What is difference between datagridview and datagrid control in winforms?

0 Answers  






How will you fill the gridview by using datatable object at runtime?

0 Answers  


What is connection string?

0 Answers  


How to add an aggregate column?

0 Answers  


What are good ado.net object to replace to ado recordset object.

0 Answers  


What is concurrency? How will you avoid concurrency when dealing with dataset? (One user deleted one row after that another user through his dataset was trying to update same row. What will happen? How will you avoid the problem?)

0 Answers  


How do you update database through dataset?

0 Answers  


What is data adapter in ado.net with example?

0 Answers  


Categories