ADO.Net Introduction

ActiveX Data Object.NET (ADO.NET) is a software library in the .NET framework consisting of software components that programmers can use to access data and data services based on disconnected access to data sources, which can be relational or non-relational (such as XML or application data).

The architecture of ADO.NET is based on two primary elements:

  1. Dataset
  2. .NET framework data provider

Dataset provides the following components:

  1. a complete set of data including related tables, constraints and their relationships
  2. functionality-like access to remote data from XML Web service
  3. manipulation of data dynamically
  4. data processing in a connectionless manner
  5. provision for hierarchical XML view of relational data

The .NET framework data provider includes the following components for data manipulation:

  1. Connection: This provides connectivity to the data source
  2. Command: This executes the database statements needed to retrieve data, modify data or execute stored procedures.
  3. DataReader: This retrieves data in forward only and read-only form.
  4. DataAdapter: This acts as bridge between dataset and data source to load the dataset and reconcile changes made in dataset back to the source.

The ADO.NET Framework supports two models of Data Access Architecture.

  1. Connection Oriented Data Access Architecture :

In Connection Oriented Data Access Architecture the application makes a connection to the Data Source and then interact with it through SQL requests using the same connection. In this case the application stays connected to the database system even when it is not using any Database Operations.When you read data from a database by using a DataReader object, an open connection must be maintained between your application and the Data Source. 

  1. Disconnected Data Access Architecture.

ADO.Net disconnected architecture solves the problem  of maintaining the connection by introduces a new component called Dataset. The DataSet is the central component in the ADO.NET Disconnected Data Access Architecture. A DataSet is an in-memory data store that can hold multiple tables at the same time. DataSet only hold data and do not interact with a Data Source. One of the key characteristics of the DataSet is that it has no knowledge of the underlying Data Source.