Recent Questions
.Net Framework : What is difference between string and stringbuilder?

What is difference between string and stringbuilder?

String is for simple string operations while StringBuilder is used to perform high manipulation stri....
Category: .Net Framework Date: 7/3/2010 1:55:44 PM
C# : Can we have a variables inside the interface?

Can we have a variables inside the interface?

No, we can have only methods, properties, indexers and enums inside the interface.
Category: C# Date: 7/3/2010 1:54:37 PM
C# : What is static class and what is use of this?

What is static class and what is use of this?

Static class we define when we do not want to create a object of class, all methods of static class ....
Category: C# Date: 7/3/2010 1:54:06 PM
OOPs Concepts : What is difference between overloading and overriding?

What is difference between overloading and overriding?

Having same name methods with different parameters is called overloading, while having same name and....
Category: OOPs Concepts Date: 7/3/2010 1:53:22 PM
.Net Framework : What is difference between Monitor.Enter and Monitor.TryEnter functions?

What is difference between Monitor.Enter and Monitor.TryEnter functions?

Monitor.Enter waits for the lock until it does not get it, while Monitor.TryEnter will request for l....
Category: .Net Framework Date: 7/3/2010 1:52:22 PM
ADO.Net Interview Questions and Answers
<< Previous Question Next Question >>
Question: 475 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
0O5lIS