Introduction to ADO.NET
The .NET Framework includes its own data access technology i.e. ADO.NET. ADO.NET is the latest implementation of Microsoft’s Universal Data Access strategy. ADO.NET consists of managed classes that allows .NET applications to connect to data sources such as Microsoft SQL Server, Microsoft Access, Oracle, XML, etc., execute commands and manage disconnected data..t
Microsoft ADO.NET is the latest improvement after ADO. Firstly, ADO.NET was introduced in the 10th version of the .NET framework, which helps in providing an extensive array of various features to handle data in different modes, such as connected mode and disconnected mode. In connected mode, we are dealing with live data and in disconnected mode, data is provided from the data store.
ADO.NET was primarily developed to address two ways to work with data that we are getting from data sources. The two ways are as follows :
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
- The first is to do with the user’s need to access data once and to iterate through a collection of data in a single instance.
- The second way to work with data is disconnected architecture mode, in which we have to grab a collection of data and we use this data separately from the data store itself.
Architecture of ADO.NET :
ADO.NET uses a multilayered architecture that revolves around a few key concepts as –
- DataSet objects
The ADO.NET architecture is a little bit different from the ADO, which can be shown from the following figure of the architecture of ADO.NET.
One of the key differences between ADO and ADO.NET is how they deal with the challenge of different data sources. In ADO.NET, programmers always use a generic set of objects, no matter what the underlying data source is. For example, if we want to retrieve a record from an Oracle Database, we use the same connection class that we use to tackle the same task with SQL Server. This is not the case with ADO.NET, which uses a data provider model and the DataSet.
Features of ADO.NET :
The following are the features of ADO.NET –
We know that XML documents are text-based formats. So, one can edit and edit XML documents using standard text-editing tools. ADO.NET uses XML in all data exchanges and for internal representation of data.
- Maintainability –
ADO.NET is built around the idea of separation of data logic and user interface. It means that we can create our application in independent layers.
- Programmability (Typed Programming) –
It is a programming style in which user words are used to construct statements or evaluate expressions. For example: If we want to select the “Marks” column from “Kawal” from the “Student” table, the following is the way to do so:
- Performance –
It uses disconnected data architecture which is easy to scale as it reduces the load on the database. Everything is handled on the client-side, so it improves performance.
- Scalability –
It means meeting the needs of the growing number of clients, which degrading performance. As it uses disconnected data access, applications do not retain database lock connections for a longer time. Thus, it accommodates scalability by encouraging programmers to conserve limited resources and allow users to access data simultaneously.