Difference between DataReader and DataAdapter / DataSet and
DataAdapter?

Answer Posted / preeti

Let’s take a look at the differences between ADO Recordset
and ADO.Net DataSet:

1. Table Collection: ADO Recordset provides the ability to
navigate through a single table of information. That table
would have been formed with a join of multiple tables and
returning columns from multiple tables. ADO.NET DataSet is
capable of holding instances of multiple tables. It has got
a Table Collection, which holds multiple tables in it. If
the tables are having a relation, then it can be manipulated
on a Parent-Child relationship. It has the ability to
support multiple tables with keys, constraints and
interconnected relationships. With this ability the DataSet
can be considered as a small, in-memory relational database
cache.

2. Navigation: Navigation in ADO Recordset is based on the
cursor mode. Even though it is specified to be a client-side
Recordset, still the navigation pointer will move from one
location to another on cursor model only. ADO.NET DataSet is
an entirely offline, in-memory, and cache of data. All of
its data is available all the time. At any time, we can
retrieve any row or column, constraints or relation simply
by accessing it either ordinarily or by retrieving it from a
name-based collection.

3. Connectivity Model: The ADO Recordset was originally
designed without the ability to operate in a disconnected
environment. ADO.NET DataSet is specifically designed to be
a disconnected in-memory database. ADO.NET DataSet follows a
pure disconnected connectivity model and this gives it much
more scalability and versatility in the amount of things it
can do and how easily it can do that.

4. Marshalling and Serialization: In COM, through
Marshalling, we can pass data from 1 COM component to
another component at any time. Marshalling involves copying
and processing data so that a complex type can appear to the
receiving component the same as it appeared to the sending
component. Marshalling is an expensive operation. ADO.NET
Dataset and DataTable components support Remoting in the
form of XML serialization. Rather than doing expensive
Marshalling, it uses XML and sent data across boundaries.

5. Firewalls and DCOM and Remoting: Those who have worked
with DCOM know that how difficult it is to marshal a DCOM
component across a router. People generally came up with
workarounds to solve this issue. ADO.NET DataSet uses
Remoting, through which a DataSet / DataTable component can
be serialized into XML, sent across the wire to a new
AppDomain, and then Desterilized back to a fully functional
DataSet. As the DataSet is completely disconnected, and it
has no dependency, we lose absolutely nothing by serializing
and transferring it through Remoting.

Is This Answer Correct ?    21 Yes 13 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between dataset and datatable?

464


What are the namespaces used in ADO.Net to connect to a database?

574


Describe ado.net object model in detail.

508


What is an orm, and why would you use one instead of plain old ado.net?

544


Explain what are the steps to connect to a database?

477






Which namespaces are used for data access?

600


Define atomicity?

563


Which method in OLEDBAdapter is used to populate dataset with records?

537


What is isolation?

546


What is the difference between Data adaptor and Data set?

496


Explain the different row versions available in table?

532


What is a dynaset in access?

504


How would you connect to database using .NET?

555


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

513


How can I retrieve two tables of data at a time by using data reader?

492