ADO.NET Structure - ADO.NET Learning & Application Notes

xiaoxiao2021-03-06  96

The core components of ADO.NET are composed of a Data Provider module and a DataSet module. The Data Provider library implements data connection, operation, and quick access to read only access. DataSet implements data access, operations independent of the data source, a bit similar to the disconnected static dataset of the ADO.

The structural diagrams of ADO.NET are as follows:

First, .NET Framework Data Provider .NET Framework Data Provider is a set of connected data sources and can perform commands for data execution commands.

(1) Four data providers of .NET Framework. NET Framework provides four sets of data providers for accessing the four types of data sources. 1, SQL Server .NET Framework data provider, which can only access MS SQL Server7.0 or higher, and earlier versions can only be accessed by OLE DB data provider. Its naming space is System.Data.sqlclient. 2, OLE DB .NET Framework data provider, used to access the OLE DB data provider, which does not support OLE DB 2.5 interface. Its namespace is System.Data.Oledb. 3, ODBC .NET Framework data provider. Used to access the ODBC data provider. Its namespace is System.Data.odbc. 4, Oracle .NET Framework data provider. Used to access Oracle data, the program requires support for Oracle client software 8.1.7 or higher. Its namespace is System.Data.OracleClient.

By implementing your own data provider group by implementing your IDBConnection interface, IDBCommand interface, iDataAdapter interface, IDBDataAdapter interface, iDataReader interface, iDataParameter interface, IDBTransaction interface, etc.

(2) The four core objects of the .NET data provider .NET data provider typically contains four core objects: 1. The Connection object provides connection with the data source. The Connection class of the data provider is the implementation of inheriting the System.Data.IDBConnection interface. 2, Command object enables you to access database commands used to return data, modify data, run stored procedures, and send or retrieve parameter information. The COMMAND class of the data provider is the implementation of inheriting the system.data.idbcommand interface. 3, DataReader provides high-performance data streams from the data source. DataReader's data stream is only busy and read-only. The DataReader class of the data provider is the implementation of inheriting the System.Data.idataReader interface. 4, DataAdapter provides bridges connecting the DataSet object and the data source. DataAPter executes the SQL command in the data source using the Command object to load the data into the DataSet and make changes to the data from DataSets consistent with the data source. The DataAPter class of the data provider is the implementation of inheriting the System.Data.idbDataAdapter interface. The .NET data provider also includes Transaction objects, Parameter objects, and more.

Second, .NET Framework DataSet connection, command, transaction, data reading acts on a particular provider, only data sets can be provided independently, in the NET Framework, Data Set Object DataSt's namespace is located in system. Data.

(1) The DataSet object model DataSet object is a core object that supports the disconnect, distributed data scheme of ADO.NET. DataSet is the memory resident representation of the data, regardless of the data source, it will provide a consistent relational programming model. You can imagine it into a relational database that is concentrated in memory. Its object model is as follows: DataSet contains three sets of collections: (1), DataTableCollection. The main object in relational database is Table, then uses this collection in the DataSet to contain multiple DataTable objects. DataTable is a data table in memory that you can identify a table by a unique name. DataSet's DataTable can store the maximum number of lines of 16,777,216. (2) DataRelationCollection. In addition to the table in relational database, there is a relationship between the tables and tables. This collection is the collection of table relationship objects. (3), ExtendedProperties. This is a set of custom information, conceptually similar to the SESSION of the ASP.

(2) The DataSet and the DataAdapterDataAdapter object are the bridges connected to the data provider and DataSet. The data provider's DataAPter class is an implementation of iDataAdapter or iDBDataAdapter. Typically DataAdapter constructor is: XxxDataAdapter (SqlCommand selectCommand) XxxDataAdapter (String selectCommandText, String selectConnectionString) XxxDataAdapter (String selectCommandText, SqlConnection selectConnection)

DataApter adds data source data, architecture, etc. to DataSet, by implementing Fill, Fillschema, updating Update to the data source to the data source.

Resources: 1. .NET Framework SDK ADO.NET Overview 2 Database-like% 20DATA% 20Containers.mspx 3, "Analysis .NET Managed Provider" Dino Espositohttp://www.microsoft.com/china/msdn/library/data/DataAccess/inside.NetManagedProviders.mspx 4, MSDN Data Access Column http://www.microsoft.com/library/mnp/2/ASPX/framesmenu.aspx?url=/china/msdn/library/data/default.mspx

转载请注明原文地址:https://www.9cbs.com/read-122767.html

New Post(0)