Difference between datareader and dataset?
Answers were Sorted based on User's Feedback
Answer / abhijeet kumar sharma
DataReader is faster for read data.DateReader is readonly
propurse,DataReader read data between reader Read() and
close() methods.When we read data from database help of
DataReader then database connection is must open.
DataSet is disconnected architecture. We store multiple
data at a time in dataset.
Is This Answer Correct ? | 6 Yes | 3 No |
Answer / govind.r
DataReader: It is used only read the data and execute the
data in database.
DataSet: But,It contain only collection of database.Not for
read and execute to the data in database.
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / ravinderreddy kothakapu
Dataset:
1)Dataset is a inmemory database for client application
process and it will contain more number of tables.
2)Dataset supports manipulations.
3)Dataset is a independent component in ADO.NET.
4)Dataset is a purly disconnected architecture with XML file
integration.XML file integration supports cross platform
independence.
5)Dataset supports bidirectional navigation.
6)Dataset defined multiple tables where contraints can be
applied.
7)Dataset can be persist the data.
Syntax: DataSet ds=new DataSet();
Data Reader:
1)Data Reader is a read only and forward only implimentation
2)Read only means it cannot support
manipulations(insert,delete, update)
3)Forward only means it support record pointer navigation in
forward direction means it is used for only once read
4) we can access only one table
5)Data reader cannot persist the data
6)It is a connected Architecture.
7)Most advantage is Data Reader is faster then Data Adapter.
Syntax:OleDb DataReader dr;
dr=cmd.ExcuteRader()
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / shivangi pandya(cojit- sy)siho
*dataset........
..it is read & write we can make changes.
..we can do insert,update,delete operatios.
..we can move previous in it.
..it is faster then datareader.
..it doesent hold any data.
..data can not be transfer to datasource.
..only one record save in a memory at a time.
..dataset is connection oriented.
*data reader........
..it is read & forward only.
..we cant do ant insert,update,delete operation.
..we can not move previous in i.t
..it is slower then dataset.
..it can holds the data table.
..data can be transfer to datasource.
..pulls the records from datasource & saves in IIS memory.
..it is disconnected oriented.
Is This Answer Correct ? | 4 Yes | 1 No |
Answer / vikas choudhary
Data Reader is faster then dataset as Datareader is a
direct method of fetching data where as dataset is indirect
method. Dtatset take data from data adapter
Is This Answer Correct ? | 7 Yes | 5 No |
Answer / abhitendra
With the help of datareader only one row of a table can be
handled
but in dataset multipul table can be handled.
Is This Answer Correct ? | 7 Yes | 5 No |
Answer / jayeshwaree
datareader:
*connected enviornment
*reads one row at a time. By using Read() we can read the
read records of one row
*used to retrieve data as it returns a result set in a read
only and forward only mode
dataset:
*disconnected enviornment
*it is used as a container to hold one or more tables with
constraints and relations
*to update the changes made in dataset we need a data
adapter and we need to call the Update() method
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / sagar
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 ? | 1 Yes | 0 No |
Answer / chitaranjan mallick
- Data Reader apply only Select Statement, It can featch data from multiple Table Through Multiple Select Statement separated by Semicolon(;) Likes For Ex:
SqlCommand cmd=new SqlCommand("Select * from Emp";" Select * From Dept",Con);
DataReader dr=cmd.ExecuteReader();
dr.NextResults();
Here NextResults() Navigate from One Tables to Anather Tables
- It is Readonly, It can featch single Record At a Time..
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / ankur
data reader is connection oriented.it can access only one
value from the database.but the advantage is that it is
faster that dataset operation.
dataset is disconnected.using dataset you can access any
number of values. it can't be used without data adapter.
dataset can contain any number of tables and it maintain
the relationship between tables. when you refesh the
dataset then the changes affect the database
Is This Answer Correct ? | 16 Yes | 16 No |
What is sqlconnection and sqlcommand?
What are the different ado.net namespaces are available in .net?
What is datasource in ado.net?
What is the difference between sqlcommand and sqldataadapter?
Explain the difference between data reader and data set?
WHAT Are the major major compnents of a data provider in ADO.net.
what is typed and untyped dataset
WHAT IS DIFF B/W VIEWS AND STORED PROCEDURE
What does ole stand for in excel?
What is isolation?
Which ado.net object is very fast in getting data from the database?
Which architecture does Datasets follow?