Home > Articles > Data > Access

  • Print
  • + Share This
This chapter is from the book

Redesigning ADO for the .NET Framework

With the ever-changing models for data access, ADO has undergone a complete redesign. However, in order for developers to transition, the older ADO methods are still available through the .NET COM interoperability services, which will be discussed in the next hour.

The need for a complete redesign is inherently due to difficulty in supporting current technology using an older design model. When designing ADO.NET, Microsoft had several key goals in mind. The first and foremost design decision was to facilitate the use of the Extensible Markup Language (XML) throughout ADO.NET. XML is a text-based language that allows for easy data transfers through corporate networks. The design of XML allows for easier data-encoding mechanisms based on an industry standard rather than the binary object–transfer mechanisms used in the past.

Supporting disconnected clients in a multitier architecture also contributed to the decision to redesign ADO. Although it was possible to create a disconnected client scenario with ADO, it was cumbersome. ADO was designed to more readily support connected clients. The key object within ADO.NET that contributes to the disconnected n-tier programming model is the DataSet object. The DataSet represents the root of an in-memory representation of the data you are working with. One of the advantages to this type of design is that you are allowed to have several tables of data from differing sources, all contained within that single DataSet (see Figure 20.1). Within the design of ADO, however, a RecordSet only contained one table. Although this table could be built from the results of a multiple table join, you were still limited to a single table. This could have been circumvented by using multiple RecordSets, but relationships could not have been established. Within ADO.NET, the DataSet object contains a collection containing relationships between parent and child tables.

Figure 20.1 Architecture of ADO.NET.

As you can see in Figure 20.1, a DataSet can contain several DataTables. These tables can contain several DataColumn collections and their associated DataRow components. While viewing a database though a database editor such as Access, you can see parallels between table design and the design of ADO.NET. This will become clearer as you work through a managed C++ lesson that uses an Access database and ADO.NET to access its data.

  • + Share This
  • 🔖 Save To Your Account