Loading, please wait...

A to Z Full Forms and Acronyms

What is ADO.NET?

Jul 08, 2020 ado.net, 3537 Views
In this article, we will be studying about ADO.Net

THE ADO in ADO.NET stands for ActiveX Data Object. In other words, it is a network technology that uses the ActiveX Data Object model.

It is a network technology introduced by Microsoft as a part of its .Net Framework. 

This technology enables users to access the database from any kind of data source and modify or manipulate their data as they want.

It is widely used to create client-server applications and distributed environments applications that run over the internet or even go with intranet.

The ADO.NET framework provides two models for data access. These are connected and disconnected architecture.

In connected mode, the connection between the database and application remains active throughout the lifetime of the operation.

In disconnected mode, the connection is established only when the data is to be read or updated to the database. The connection closes after the reading or updating operation.

ADO.NET  uses SQL-Queries and stored procedures to read, write, update, or delete data from a data source.

ADO.NET Object Model

ADO.Net Data access depends on two components:

  1. Net Data Providers
  2. DataSet

Data Providers:  A .Net Data Provider helps in providing and maintaining a connection with the database.

  • Some data providers are :
  1. .Net Framework for Data Provider for SQL Server.
  2. .Net Framework for Data Provider for Oracle.
  3. .Net Framework for Data Provider for ODBC
  4. .Net Framework for Data Provider for OleDB

The .Net Framework for Data Provider for SQL Server uses its own strategies and protocols to interact with SQL Server.

The namespace System.Data.SqlClients provides all the classes for this provider.

Core Objects of Data Provider:

  1. Connection: This object helps in establishing a connection between the database and the application.

The examples of connection object are SqlConnection , OleDBconnection,OracleConnection etc.

  1. Command: This helps in providing commands that can be used to manipulate the existing data, dataTable or table schema, etc.

Examples of command objects are SqlCommand, OracleCommand, etc.

SqlCommandBuilder: SqlCommandBuilder object is used to automatically create SQL queries for single-table updates.

It eradicates the pressure of designing and implementing queries as it automatically creates them.

  1. DataReader: It is an object that works only in connected mode. It helps in retrieving and viewing the rows returned as a result of a query given to the SQL Server in such a way that one row is performed with operation at a time.

It doesn’t support updating. The data returned by the DataReader is in a read-only form.   

  1. DataAdapter: It acts as a bridge between the connected and disconnected architecture of ado.net.

The examples of the DataAdapter object are SqlDataAdapter, OracleDataAdapter, etc.

DataSet Class in ADO.NET

It is an in-memory data store that can hold more than one table in it.  DataSet can contain a collection of data including tables, relationships among tables, and different constraints.

It is used to fetch data without interacting with the Data Source, therefore, it is called a disconnected data access method.

The component objects of DataSet are:

  1. DataTable: A collection of tables, relationships, and constraints is contained within a DataSet object.

DataTable objects are used to store and manipulate data in tables in a DataSet object.

  1. DataColumn: Every DataSet object has a collection of Columns which is contained within a DataColumn object. Each data column object corresponds to a column in a specific table.
  2. DataRow: Every DataSet object has a collection of rows which is contained within a DataRows object. Each DataRow object corresponds to a row in a specific table.

We use an object’s a Row collection to access any data row object to access the values stored in a DataTable object.

  1. DataView: We use a DataView object to view data retrieved as a result of a query applied onto a DataTable object.

 We can view the data in any way.

For example:  filtered only according to the rows or even according to the columns in a DataTable object.

  1. DataRelation: A DataRelation object is used to hold and represent various inter-related tables in a DataSet object. We can perform functions like adding validation on data and browsing functions.
A to Z Full Forms and Acronyms

Related Article