ADO.NET offers several advantages over previous Microsoft data access technologies, including ADO. The following sections outline these advantages.
As discussed earlier, with the many available data access methods, sometimes developers are confused about which technology to use. For example, to work with Microsoft Access databases, you can use ODBC, DAO, OLE-DB, ADO, DAO, or ODBC MFC classes.
Which one would you choose? It all depends on your requirements. Another problem with these technologies is installing the right version. For example, ODBC and ADO have different versions of DLLs, and some of these versions aren't backward or forward compatible. So, if a user is running some programs that require ODBC 3.0 and your application uses ODBC 3.5, then the user will have to install ODBC 3.5 to run your application. However, the users' programs that are based on ODBC 3.0 may not work properly after installing ODBC 3.5. Having multiple DLL versions is a well-known problem, termed DLL hell.
ADO.NET provides a single object-oriented set of classes. Different data providers work with different data sources, but the programming model for all these data providers work in the same way. So, if you know how to work with one data provider, you can easily work with others. It's just a matter of changing class names and connection strings.
You can use more than one data provider to access a single data source. For example, you can use Odbc or OleDb data providers to access Microsoft Access databases.
The ADO.NET classes are easy to use and easy to understand because of their object-oriented nature.
The ADO.NET classes are managed classes. They have all the advantages of the .NET CLR, such as language independency and automatic resource management. All .NET languages access the same API. So, if you know how to use these classes in C#, you will have no problem using them in VB .NET. Another big advantage is you don't have to worry about memory allocation and freeing it. The CLR takes care of it for you.
Today, XML is an industry standard and the most widely used method of sharing data among applications over the Internet. As mentioned earlier, in ADO.NET data is cached and transferred in XML format. All components and applications can share this data, and data can be transferred via different protocols such as HTTP. We explain this topic in more detail in Chapters 6 and 7.
VS .NET offers ADO.NET components and data-bound controls to work in visual form. That means you can use these components as you use any Windows controls. You drag and drop these components on Windows and Web Forms, set their properties, and write events. This helps programmers to write less code and develop applications in no time. VS .NET also offers the Data Form Wizard, which helps you create full-fledged database applications without writing a single line of code. Using these components, you can directly bind these components with data-bound controls by setting these control's properties at design-time. Chapter 4 explains this in detail.
Performance and scalability are two major factors when developing Web-based applications and services. Transferring data from one source to another is a costly affair over the Internet because of connection bandwidth limitations and rapidly increasing traffic. Using disconnected cached data in XML takes care of both of these problems.