What is the difference between data reader and data adapter ?

Editorial / Best Answer

Answered by: Madhukar Singh

  • Aug 11th, 2006


DateReader is an forward only and read only cursor type if you are accessing data through DataRead it shows the data on the web form/control but you can not perform the paging feature on that record(because it's forward only type). Reader is best fit to show the Data (where no need to work on data)

DataAdapter is not only connect with the Databse(through Command object) it provide four types of command (InsertCommand, UpdateCommand, DeleteCommand, SelectCommand), It supports to the disconnected Architecture of .NET show we can populate the records to the DataSet. where as Dataadapter is best fit to work on data.

Showing Answers 1 - 29 of 29 Answers

Achint Kishore

  • Aug 6th, 2006
 

DataReader directly access the table and it is only used for reading the records from it whereas dataadapter, used to maintain connection, is always used with dataset as dataset is of disconnected-architecture in nature.

Madhukar Singh

  • Aug 11th, 2006
 

DateReader is an forward only and read only cursor type if you are accessing data through DataRead it shows the data on the web form/control but you can not perform the paging feature on that record(because it's forward only type). Reader is best fit to show the Data (where no need to work on data)

DataAdapter is not only connect with the Databse(through Command object) it provide four types of command (InsertCommand, UpdateCommand, DeleteCommand, SelectCommand), It supports to the disconnected Architecture of .NET show we can populate the records to the DataSet. where as Dataadapter is best fit to work on data.

Yasir_Aziz

  • Aug 6th, 2007
 

Is there any comparison between the two?
I think Comparison between Data Reader and Data Set is more Logical.
Anyway,

DataReader
Works in Connected Mode
Forward Only, Read Only

DataAdapter
Works in Disconnected Mode
Both Side Movements, Read/Write

  Was this answer useful?  Yes

Priestly George Varghese

  • Sep 7th, 2007
 

Datareader is connection oriented,it moves in the forward direction only,it keeps single row at a time.

Dataadapter acts as a bridge between datasource and dataset and it is a multipurpose object ie, we can insert, update, delete throught dataadapter

  Was this answer useful?  Yes

abhi.desai

  • May 16th, 2008
 

The DataSet consists of a collection of DataTable objects that you can relate to each other with DataRelation objects. A DataSet can read and write data and schema as XML documents..The DataReader object is the ADO.NET counterpart of the read-only, forward-only default ADO cursor

  Was this answer useful?  Yes

Data Reader: It reads the data only only one direction when there is no need to manipulate our data.



Data Adapter:- When we use four commands - Insert, Delete, Update and Select than this one is good..

  Was this answer useful?  Yes

kasam_as

  • Sep 17th, 2008
 

Data Reader: It take the data sequentially from the command object and requies the connection should be open while it is getting data.

Data Adapter: It fetch all the required data from database and pass it to DataSet.

DataSet: It get all the required data from Data Adapter. It contains data in the form of Data Table.

DataSet : it is  a disconnected Articeture...

Connected Architecture : Means that while SqlDataReader reads the data from database and also reading data from SqlDataReader to any variable the connection to database should be open. Also once you read some data from SqlDataReader, you should save them becouse it is not possible to go back and read it again.

DataReader : it is a Connected Articeture...

Disconnected Architecture : It is followed by Dataset. In this once the data has been read by Dataset from SqlDataAdapter, we can close the connection to database and retirve the data from Dataset where ever we want. Dataset hold the data in the form of table and do not interact with Datasouse. 

  Was this answer useful?  Yes

Data Adapters are integral part of ADO.Net.  It is simply a link b/w data reader and data. Adapters are used to exchange data between data source and dataset.

 

  Was this answer useful?  Yes

Deepak

  • Feb 15th, 2013
 

1. A DataReader works in a connected environment, whereas DataSet works in a disconnected environment.

2. A DataSet represents an in-memory cache of data consisting of any number of inter related DataTable objects. A DataTable object represents a tabular block of in-memory data.

  Was this answer useful?  Yes

Datareader- works in fast forward read only mode to fetch data from the database. It works in connected environment.
DataAdapter- Works as a bridge between the database and Ado.net and Fills the dataset. It works as a bridge to work in a disconnected environment.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions