What is the difference between ADO and ADO.NET?

ADO uses Recordsets and cursors to access and modify data. Because of its inherent design, Recordset can impact performance on the server side by tying up valuable resources. In addition, COM marshalling - an expensive data conversion process - is needed to transmit a Recordset.
ADO.NET addresses three important needs that ADO doesn't address:
1. Providing a comprehensive disconnected data-access model, which is crucial to the Web environment
2. Providing tight integration with XML, and
3. Providing seamless integration with the .NET Framework (e.g., compatibility with the base class library's type system).
From an ADO.NET implementation perspective, the Recordset object in ADO is eliminated in the .NET architecture. In its place, ADO.NET has several dedicated objects led by the DataSet object and including the DataAdapter, and DataReader objects to perform specific tasks. In addition, ADO.NET DataSets operate in disconnected state whereas the ADO RecordSet objects operated in a fully connected state.
In ADO, the in-memory representation of data is the recordset. In ADO.NET, it is the dataset.
A recordset looks like a single table. If a recordset is to contain data from multiple database tables, it must use a JOIN query, which assembles the data from the various database tables into a single result table. In contrast, a dataset is a collection of one or more tables. The tables within a dataset are called data tables; specifically, they are DataTable objects. If a dataset contains data from multiple database tables, it will typically contain multiple DataTable objects. That is, each DataTable object typically corresponds to a single database table or view. In this way, a dataset can mimic the structure of the underlying database.
In ADO you scan sequentially through the rows of the recordset using the ADO MoveNext method. In ADO.NET, rows are represented as collections, so you can loop through a table as you would through any collection, or access particular rows via ordinal or primary key index.
A cursor is a database element that controls record navigation, the ability to update data, and the visibility of changes made to the database by other users. ADO.NET does not have an inherent cursor object, but instead includes data classes that provide the functionality of a traditional cursor. For example, the functionality of a forward-only, read-only cursor is available in the ADO.NET DataReader object.
There is one significant difference between disconnected processing in ADO and ADO.NET. In ADO you communicate with the database by making calls to an OLE DB provider. In ADO.NET you communicate with the database through a data adapter (an OleDbDataAdapter, SqlDataAdapter, OdbcDataAdapter, or OracleDataAdapter object), which makes calls to an OLE DB provider or the APIs provided by the underlying data source.

Showing Answers 1 - 4 of 4 Answers

samiksc

  • Jan 17th, 2006
 

  1. ADO objects are COM objects. ADO.Net objects are represented using XML
  2. ADO objects have difficulty travelling through firewalls. ADO.Net objects, represented as text (XML), travel easily through all kinds of network restrictions.
  3. ADO recordsets are heavier than the ADO.Net counterparts, datasets.
  4. ADO recordsets can hold data from one data source at a time. ADO.Net datasets can hold data from various sources and integrate the data and write it back to one / several data sources.
  5. ADO.Net dataset represents in memory representation of a database. ADO recordsets is merely a set of rows retrieved from a data source.

  Was this answer useful?  Yes

Maddy

  • Nov 6th, 2007
 

Even in ADO there is a concept of shaped queries where we can access the records from multiple tables without using joins.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions