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
What are all the different methods under sqlcommand?
What are all components of ADO.Net data provider?
What is ado.net components?
Is entity framework better than ado.net?
What are advantages of microsoft-provided data provider classes in ado.net?
Explain the two fundamental objects in ado.net?
How can we serialize the dataset object?
How to check if a datareader is closed or opened? IsClosed()
What is an ado connection?
Can datareader hold data from multiple tables?
How do you update a dataset in ado.net?
What are all the different authentication techniques used to connect to MS SQL Server?
What is serialization and de-serialization in .net?
What do you mean by performing asynchronous operation using command object?
What is data relation in ado.net?