Difference between datareader and dataset?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
What is the difference between a datareader and a dataset?
Can we do database operations without using any of the ado.net objects?
How to get oledb connection?
About ado.net components/objects. Usage of data adapters and tell the steps to retrieve data ?
What is the use of adodc?
Where does ADO.NET and XML web services come in the architecture ?
Define ado.net?
Do we use stored procedure in ADO.Net?
Explain the dataadapter class in ado.net?
How do you connect to sql server database without using sqlclient?
Explain how to call the sql commands asynchronously in ado.net version 2.0?
When multiple users attempt to modify data at the same time Ex user 1 is updating record at same time user2 deleted record sucessfully.now user1 has press update button . how to handle concurrency