What is ADO.NET?


What is ADO.NET? 

  • ADO stands for ActiveX Data Objects
  • ADO.NET is a database technology of .NET Framework used to connect application system and database server.
  • ADO.NET is a part of the .NET Framework
  • ADO.NET consists of a set of classes used to handle data access
  • ADO.NET uses XML to store and transfer data among applications, which is not only an industry standard but also provide fast access of data for desktop and distributed applications.
  • ADO.NET is scalable and interoperable.

ADO.NET Architecture

arctitecture.gif

Advantages of ADO.NET

 

ADO.NET offers several advantages over previous Microsoft data access technologies, including ADO. Few advantages are listed below:

 

Single Object-oriented API

 

ADO.NET provides a single object-oriented set of classes. There are different data providers to work with different data sources but the programming model for all these data providers work in the same way. You should be aware of only one data provider. You just need to change class names and connection strings.

 

The ADO.NET classes are easy to use and understand, as they are object-oriented in nature.

 

Managed Code

 

The ADO.NET classes are managed classes. CLR takes care of language independency and automatic resource management.

 

Deployment

 

Microsoft uses MDAC (Microsoft Data Access Component), which is used as ActiveX component in .NET Framework (X is extensible component, when X is written after a term means extensible). .NET components takes care of deployment which was difficult previous technologies used in deployment.

 

XML Support

 

ADO.NET data is cached and transferred in XML (EXtensible Markup Language) format. XML provide fast access of data for desktop and distributed applications. XML is plain text designed to transport and store data and is self-descriptive.

 

Visual Data Components

 

.NET offers ADO.NET components and data-bound control to work in visual form.  You can use these components without writing long codes and can achieve result in no time.

 

Performance and scalability

 

Performance and scalability are two major factors when developing web-based application and services. Disconnected cached data in XML help in performance and scalability.

Difference between ADO and ADO.NET

ADO ADO.NET

ADO has one main object that is used to reference data, called the RecordSet object.

ADO.NET provides objects that allow you to access data in various ways. The DataSetobject allows you to store the relational model of your database.  MARS (Multiple Active Result Sets) is implemented in ADO.NET

You can only work on connected manner. This means that when you access data, such as viewing and updating data, it is real-time, with a connection being used all the time. This is barring, of course, you programming special routines to pull all your data into temporary tables.

 

In connected model you always get refreshed data.

ADO.NET uses data in a disconnected fashion. When you access data, ADO.NET makes a copy of the data using XML. ADO.NET only holds the connection open long enough to either pull down the data or to make any requested updates. This makes ADO.NET efficient to use for Web applications. It's also decent for desktop applications.

 

You can work on connected and disconnected manner.

 

In disconnected model you will get old data as you are editing it. Outlook is an example of disconnected model. We work on offline object model and when connection is required it is connected.

 

Connected object can be used on disconnected object.
 

Whereas ADO allows you to persist records in XML format. ADO.NET allows you to manipulate your data using XML as the primary means. This is nice when you are working with other business applications and also helps when you are working with firewalls because data is passed as HTML and XML.
ADO allows you to create client-side cursors only. ADO.NET gives you the choice of either using client-side or server-side cursors. In ADO.NET, classes actually handle the work of cursors. The developer has the freedom of choice in internet development, for creating efficient applications.


Conclusion

Hope the article would have helped you in understanding ADO.NET, its advantages and its architecture.

 

Your feedback and constructive contributions are welcome.  Please feel free to contact me for feedback or comments you may have about this article.