ADO.Net Interview Questions and Answers
<< Previous Question Next Question >>
 Question: 1556 Page Views: 

How to make decision about using DataSet over DataReader?



Posted By: Avi Date: 6 October 2009 05:56:34 AM
 Answer:

Use a DataSet when you need to do following:

1) Navigate between multiple discrete tables of results.

2) Manipulate data from multiple sources (for example, a mixture of data from more than one database, from an XML file, and from a spreadsheet).

3) Exchange data between tiers or using an XML Web service. Unlike the DataReader, the DataSet can be passed to a remote client.

4) Reuse the same set of rows to achieve a performance gain by caching them (such as for sorting, searching, or filtering the data).

5) Perform a large amount of processing per row. Extended processing on each row returned using a DataReader ties up the connection serving the DataReader longer than necessary, impacting performance.

6) Manipulate data using XML operations such as Extensible Stylesheet Language Transformations (XSLT transformations) or XPath queries.


Use a DataReader if you need to do following:

1) Do not need to cache the data.

2) Are processing a set of results too large to fit into memory.

3) Need to quickly access data once, in a forward-only and read-only manner.


Posted By: eTechPlanet


Date: 6 October 2009 05:56:34 AM
Post a better Answer if you have
 
(Will show your Gravatar icon)  
  Country flag

Loading
Enter the text as shown in the image Ksq7TG
Related Questions
ADO.Net : What is the difference between DataSet.Clone() and DataSet.Copy() methods?

What is the difference between DataSet.Clone() and DataSet.Copy() methods?

DataSet.Clone(): It only copies structure, does not copy data. DataSet.Copy(): Copies both structur....
Category: ADO.Net Date: 10/6/2009 6:37:58 AM
ADO.Net : How can we force the Connection object to close after DataReader object is closed?

How can we force the Connection object to close after DataReader object is closed?

We use ExecuteReader method of Command object to get the DataReader object. This ExecuteReader metho....
Category: ADO.Net Date: 10/6/2009 6:34:42 AM
ADO.Net : How to make decision about using DataSet over DataReader?

How to make decision about using DataSet over DataReader?

Use a DataSet when you need to do following: 1) Navigate between multiple discrete tables of resul....
Category: ADO.Net Date: 10/6/2009 5:56:34 AM
ADO.Net : What is the difference between DataSet and DataReader?

What is the difference between DataSet and DataReader?

Following are some major differences between DataSet and DataReader: 1) DataReader provides forward....
Category: ADO.Net Date: 10/6/2009 5:47:03 AM
ADO.Net : What is a DataReader object?

What is a DataReader object?

DataReader object provides a read-only, forward-only stream of data from a database. The DataReader ....
Category: ADO.Net Date: 10/6/2009 5:35:46 AM