DataReader VS Dataset

Question posted in Computer Software on 06 2010
Rate question difficulty level 0 Votes
What are the differences between dataset and datareader and how do you choose with what to work ?
 
 
6 Answers
 
DataSet is disconnected architecture model i.e., get the data and the conection is closed.
DataReader is connected architecture model i.e., connection state has to open to read the data and it is faster in retrieval.
It is the decision to be made on your requiement, generally DataSet serves the most of the job.

06/30/2010
 
 
The DataReader object is usually used to retrieve a read-only, forward-only stream of data from a database.

On the other hand, the DataSet is an in-memory cache of data retrieved from a data source. A bit like a temporary copy of the database with the data retrieved

The DataReader is used when performance, speed is required whereas the DataSet when data manipulation is necessary.

07/01/2010
 
 
@Walid and @Guest you guys gave the answers to what DataSet and DataReader exactly are but we had one more question "How to choose with what to work?

DataReader as @walid said is used to retrieve read-only data from dataset, it gets the data one-line-at-a-time from the database thus making it very fast. It is used mainly when we need to JUST DISPLAY SOME DATA to the user. There will be no transactions allowed in it and also it requires a database connection to be open.

DataSet on the other hand creates a replica of the actual database in the application cache and does all the transactions i.e. modify, add, remove datas and finally updates the values in the actual database. We use this when the user needs to edit data entries while viewing them.

07/24/2010
 
 
DataSet is a collection of Tables. Just Like a Complete Database
Add,Modify,Delete are operation can be performed
but DataReader is only just Display Data

07/29/2010
 
 
You raelly saved my skin with this information. Thanks!

01/01/2012
 
 
 
 
Add an answer*
 
Your name
Email
 
Company: iforex
Location: Israel
.net c# programming

add a question

arrow_blue


Now hiring!
---------------------------
---------------------------
---------------------------
---------------------------
Mercer 
---------------------------
---------------------------
---------------------------