Difference between DataReader and DataAdapter / DataSet and
DataAdapter?

Answer Posted / anul haq

When accessing data the DataReader is the hands down winner.
Performance increases almost exponentially over the DataSet
when more than a few queries are executed sequentially.


Simple, fast forward, read-only access to result sets is the
DataReader's favorite pastime. If data doesn't need to be
modified, cached or serialized consider using a reader.


Don't dismiss the DataReader just because you need results
in XML. Try using the ExecuteXmlReader method of the
SqlCommand class. Just don't forget the FOR XML clause in
your query.


Business applications with a strong BLL that coerce
requested data into new types can use a DataReader without
fear of lost scalability. Often times the application's
business objects can easily duplicate or enhance some of the
functionality that the DataSet is so popular for. Creating
those business objects can mean the difference between an
application that entirely relies on DataSets to one that can
leverage their usefulness only where need be.


Binding of read-only data is much more efficient using a
reader. Just imagine how many times a day that DropDownList
you use is populated. Remember how much things cost in the
long run.

Is This Answer Correct ?    20 Yes 21 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to add an aggregate column?

531


What is the use of adodc?

526


What is sqlconnection and sqlcommand?

517


What is the difference between executequery and executenonquery?

507


What is meant by ‘transaction’ in a database and what are the ‘properties of transaction’?

531






Explain the difference in an abstract class and an interface?

501


How does entity framework work?

464


What is the difference between a datareader and a dataset?

518


What is maximum pool size in ado.net connection string?

497


Explain the difference between data reader and data set?

486


Does executenonquery return a value?

538


What is linq and entity framework?

514


What is a string variable?

487


What is ado.net explain with diagram?

513


how to create a quiz software using 4 options to answer and how to check with answers in the database and award marks....

3710