Introduction to ADO.NET Architecture
ADO.net architecture is the data processing technology in which it is commonly dependent primary connection based two-tier model, its aim to create the bridge between ASP.net and backend database, first it allows the applications to access various types of data by using the same methodology and to access a SQL Server database by using a different set of classes, secondly, it provides two models for data access one is connected model where we can keep the connection with the database and perform data access and other is to get all the data in its objects that let us perform data access on disconnected objects, it is also a set of classes which comes with the Microsoft .net framework, it works as a library in .NET framework.
Architecture of ADO.net
ADO.net architecture has two main components for accessing and manipulating data that are, .net framework data providers and data set. ADO.net is designed to work with various kinds of data sources. The following diagram represents the components of the ADO.net model and also explained how they work.
The above diagram shows the relationship between the dataset which contains a collection of data tables, data table contains a collection of data rows, data columns, data relation. The data table is a map with the tables in the database. From the diagram, it is clear that the data set can have one or more than one data table object. The .Net framework data provider shares the common components which represent the data. There is an XML that is used to store and transfer the data between the various applications and the data provider. The components in architecture represent the data.
The various components of ADO.net architecture are described below to show their work.
1.(Dot) Net framework data providers
It is a component designed for fast data manipulation, in which we can only able to forward it or we can only read the data. The data provider objects of the data source are different where common class objects are used.
It is used to create a connection between the data source and the program for communication. We can make connectivity to the data source with the help of a connection object. For example, sqlconnection, oledbconnection, etc. It also maintains the connection between the back end and the front end by passing queries. The connection object we used in a connection depends on the type of data source.
There is a command object which is used to execute the command, this is different for different-different connections, for example, sqlcommand, oledbcommand. By using it we can able to access database commands so that we can perform some operations like return data where we can return data from the database, modify data where we can do modifications in present data, we can run stored procedures by using command object and we also can send or retrieve parameters of information from the database, it means to retrieve add, update and delete we use Select, Insert, Update and Delete queries. There is a query command builder which helps to construct queries so that we can construct SQL Select easily.
- Data Reader:
This data provider is used to store the data that get while data accessing, for example, sqldatareader and oledbdatareader, it provides a high-performance stream of data from the data source. It is used to read data from data sources sequentially so it provides a very efficient way to access data.
- Data Adapter:
It provides the bridge between the dataset and the data source. It is used to fill and update the dataset. To execute SQL query, the data adapter uses command object at the data source to load both the dataset with data and compose the changes that were made to the data in dataset back to the data source. The data adapter work on data set and it knows how to populate it and the adapter make the connection between data source.
The dataset is explicitly designed for accessing data from any data source independently. It works on a disconnected data access model, So as a result it can be used with various and differing data sources which can be used with XML data otherwise it can be used to managed data local to the application. The dataset is a collection of data tables and data relations. It has some classes, object rows, columns of data, it also contains the primary key, foreign key, and constraint. Those also contain the relation between the data in the data table objects. When the dataset is filled with data then data is stored in it after that the connection with the data source is getting disconnected. It gets updated by using a data adapter after that the data is updated in the data source.
It has two factors that are Data Table and Data view
- Data Table:
Data Table is a collection of data tables so that it represents the collection of data tables.
- Data View:
It is a type of dataset which represents the different types of data views it means data view contains a different type of views of data. So that it also has some types of views of data that are data column, data row, data relation. This is-
- Data columns represent the columns of the data table.
- Data row represents the rows in the data table.
- Data relation is representing the relation between different types of tables.
In the above article, we conclude that this architecture is connection orientated architecture in ADO.net in which the database is connected to the back end, so we can also conclude that there is an ADO.net that behaves as a mediator between the front end and back end which help for interaction in architecture, for more details we draw a structure of its architecture.
This is a guide to ADO.NET architecture. Here we discuss the architecture is connection orientated architecture in ADO.net in which the database is connected to the back end. You may also have a look at the following articles to learn more –