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

What is the use of SqlCommandBuilder?

725


What is the meaning of object pooling?

688


What is Data view?

661


Can we load multiple tables in a dataset?

635


Define different execute methods of ADO.NET command object ?

629






List the 4 common ado.net namespaces?

770


What we do with the object of ado.net dataset after using it?

591


What is data relation?

587


What is the difference between Data adaptor and Data set?

604


Define Execute Reader?

693


What is execute scalar in ado.net?

587


Explain the difference between an ado.net dataset and an ado recordset?

615


What is ado.net and its architecture?

589


what is the difference betwen typed dataset and untyped dataset?in general which dataset can we use in programming?

624


describe the dataset object in ado.net.

605