GeekInterview.com
Series: Subject: Topic:
Question: 36 of 58

What is the difference between data reader and data adapter ?

Asked by: Interview Candidate | Asked on: Aug 4th, 2006

Editorial / Best Answer

Answered by: Madhukar Singh

Answered On : 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 - 11 of 11 Answers
Achint Kishore

Answered On : 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.

Yes  1 User has rated as useful.
  
Login to rate this answer.
Madhukar Singh

Answered On : 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.

Yes  2 Users have rated as useful.
  
Login to rate this answer.

Datareader is connected mode. and read and forward-only Data.

DataAdapter is Bridge between Database and DataSet.

  
Login to rate this answer.
Yasir_Aziz

Answered On : 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

  
Login to rate this answer.
Priestly George Varghese

Answered On : 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

  
Login to rate this answer.
abhi.desai

Answered On : May 16th, 2008

View all answers by abhi.desai

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

  
Login to rate this answer.
ag_amazine2u

Answered On : Aug 12th, 2008

View all answers by ag_amazine2u

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..

  
Login to rate this answer.
kasam_as

Answered On : Sep 17th, 2008

View all answers by kasam_as

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. 

  
Login to rate this answer.
basit_farooq

Answered On : Apr 19th, 2010

View all answers by basit_farooq

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.

 

  
Login to rate this answer.
Deepak

Answered On : 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.

  
Login to rate this answer.

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.

  
Login to rate this answer.

Give your answer:

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

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.