You can understand the functionality of ADO.NET by comparing the features of ADO.NET with ActiveX Data Objects (ADO).
Data Memory Representation
In ADO, the memory is represented in the form of a recordset. In ADO.NET, it is a data set. There is an important difference between them.
Number of tables
The record set looks like a single table. If the recordset will contain data from multiple database tables, it must use the Join query to combine the data from each database table to a single result table.
Instead, the data set is a collection of one or more tables. The representation of the data set is a data sheet; it is clear that they are a DataTable object. If the data set contains data from multiple database tables, it usually contains multiple DataTable objects. That is, each DataTable object usually corresponds to a single database table or view. In this way, the data set can imitate the structure of the underlying database.
Data sets typically also contain relationships. The relationship within the data set is similar to the foreign key relationship in the database, ie it associates rows in multiple tables. For example, if the data set contains a table related to the investor's table and another table for each investor's stock purchase situation, the data set may also contain a relationship to connect the corresponding rows of the various rows and purchase forms of the investor table.
Since the data set can save multiple independent tables and maintain information about the relationship between the tables, it can save more data structures that are much larger than the recordset, including the self-associated tables and tables with multiple pairs of relationships.
Data navigation and cursor
In ADO, you use the ADO MOVENEXT method to scan the rows of records. In ADO.NET, the line is expressed as a collection, so you can sequentially pass the table in turn, or through the serial index or primary key index. DataRelation object maintains information about the main records and detailed information, and provides methods to get the records related to the records being operated. For example, starting from the row of the "Nate Sun" from the Investor table, you can locate the set of rows to the Purchase table.
"Cursor" is a database element that controls the ability to record navigation, update the data and other users to change the visibility of the database. ADO.NET does not have inherent cursor objects, but includes a data class that provides a traditional cursor function. For example, the function of only entering, read-only cursors are available in the ADO.NET DataReader object. For more information on cursor functions, see Data Access Technology.
Reduce the time of the connection to the lowest
In ADO.NET, open the connection time is sufficient to perform database operations, such as "Select) or" Update). You can read the line into the data set and use them without keeping the connection with the data source. In ADO, the record set can provide unconnected access, but ADO is mainly for connection to access.
There is a significant difference between the non-connection processing in ADO and ADO.NET. In ADO, communicate with the database by calling the OLE DB provider. However, in ADO.NET, you communicate with database via a data adapter (OLDATAADAPTER, ODBCDataAdapter, or OracleDataAdapter object), which calls the OLE DB provider or the API provided by the underlying data source. The main difference between ADO and ADO.NET is that in ADO.NET, the data adapter allows you to control changes to the changes to the database to the database, how to implement performance optimization, perform data verification checks or add other Any additional processing.
Note that the data adapter, data connection, data command, and data reader are components that make up the .NET Framework data provider. Microsoft and third-party vendors may provide other providers that can also be integrated into Visual Studio. For information on different .NET data providers, see the .NET data provider.
Sharing data between applications
The application room transmission ADO.NET data set is much easier than the recorded set of the transmitted ADO is not connected. To transfer ADO's recording set from one component to another, use COM. To transfer data in ADO.NET, use the data set, which can transmit an XML stream.
The transmission of XML files provides the following conveniences relative to COM.
More abundant data type
COM seal provides a limited set of data types (those defined by the COM standard). Since the data set transfer in ADO.NET is based on an XML format, there is no restriction on the data type. Therefore, components of shared data sets can use any of these components that are generally used by any rich data type sets.
performance
Transport large ADO record sets or large ADO.NET data rally uses network resources; as the amount of data increases, the pressure applied to the network is also increasing. Both ADO and ADO.NET allow you to minimize data transmitted. But ADO.NET also provides another performance advantage: ADO.NET does not require data type conversion. Need COM seals ADO to transfer records between components, you need to convert the ADO data type to COM data type.
Firewood
The firewall can affect two components that attempt to transmit unconnected ADO records. Keep in mind that the firewall is usually configured to allow HTML text to pass, but prevent system-level requests (such as COM blocking).
Since the components exchange the ADO.NET database using XML, the firewall can allow the data set to pass.