Ado. net Name Source :
Ado. net The name ADO . Use Ado. net Name because Microsoft It is expected to indicate that this is The data access interface that is preferentially used in the. NET programming environment.
Ado. net Design Objectives :
1. Simple access to Relational Data
Ado. net The main goal is to provide simple access to relational data, that is, to describe tables, columns, and rows in relational databases through relatively easy-to-use classes. Introduced Dataset Class, which significantly extends the functions of the data access interface.
2. Multi-layer applications supportedProgram
Multi-layer architecture applications are the most common architecture of today's commercial and e-commerce applications, Ado. net Use open Internet Standard XML Format: communication between layers, allowing data to pass through Internet And allow Microsoft Technology to achieve one or more layers. At the same time Ado. net For Disconnected N The layer programming environment provides first-class support.
3. Integration XML Supported
XML It is closely related to data access, that is XML All content is related to data encoding, and more data access content XML . XML Store data in a data set in the background, and maintain the relationship and constraints in the data. Ado. net The data in can be easily stored in XML Data files to facilitate offline use. In addition, Ado. net Save the data architecture to the standard XML Architecture for use.
Ado. Net class and object:
The ADO. NET component is designed to extract data access from data operations. ADO. net core components: DataSet and. net Framework Data Provider Program, which is a group of components including connection, command, commandbuilder, datareader, and dataadapter objects.
Ado. Net basic class:
The data provider objects object is dedicated to each type of data source. It is dedicated to the comsumer objects of data provider objects to read and write data in the data source. Comsumer objects is an object that reads data into the memory and is used to access and operate data. Comsumer objects is used in non-connection mode. After the database connection is closed, data in the memory can also be used. Data Provider objects requires active connections. You can use them to read data first, and then use consumer objects to use data in memory and update data in the data source using data provider objects as needed.
Ado. Net Structure
1... NET Framework data provider
The. NET Framework data provider program is used to connect to the database, execute commands, and retrieve results.
(1) Four. NET Framework data providers
1. SQL Server. NET Framework data provider: used to access Microsoft SQL Server 7.0 or later. In the namespace of system. Data. sqlclient. For earlier versions of Microsoft SQL Server, use the ole db. NET Framework data provider with the SQL Server OLE DB Provider (sqloledb.
2. ole db. NET Framework data provider: used to access the ole db data provider. This program does not support the ole db 2.5 interface. In the system. Data. oledb namespace.
3. ODBC. NET Framework data provider: used to access the ODBC data provider, which is located in the system. Data. ODBC namespace.
4. Oracle. NET Framework data provider: supports Oracle client software version 8.1.7 and later. It is located in the system. Data. oracleclient namespace and included in the system. Data. oracleclient. dll assembly. When compiling an application that uses the data provider, both system. Data. dll and System. Data. oracleclient. dll.
(2) four core objects of the. NET data provider
1. connection object: provides a connection to the data source.
2. Command object: a database command that issues commands, including returning data, modifying data, running stored procedures, and sending or retrieving parameter information.
3. datareader object: Read Only forward and read-only data streams from the data source. Fast and efficient.
4. dataadapter object: You can perform various operations on the data source, including filling in dataset, updating changed data to the data source, and keeping changes to the data in dataset consistent with the data source.
Ii.. NET Framework Dataset
Dataset objects are the core objects that support ADO. Net's disconnected and distributed data solutions. Dataset is the memory resident representation of data. No matter what the data source is, it provides a consistent relational programming model. Therefore, a dataset can contain different datatable data from different data sources, a dataset can correspond to one or more data sources. It can be used for multiple different data sources, for XML data, or for managing local data of applications. In the system. Data namespace.
DataSet object model
The methods and objects in dataset are the same as those in the relational database model. It can be viewed as a relational database in memory.
Dataset can also maintain and reload its content in XML format, and maintain and reload Its Schema in XML Schema Definition Language (XSD) architecture.
Three sets of Dataset
1. datatablecollection: datatablecollection contains all the able objects in the dataset. Datatable is defined in the system. Data namespace, which indicates that the memory resident data table. It contains A collection of columns represented by datacolumncollection and constraints represented by constraintcollection. These columns and constraints define the architecture of the table together. Datatable also contains the set of rows represented by datarowcollection, while datarowcollection contains data in the table. In addition to its current status, datarow retains its current and initial versions to identify changes to the values stored in the row.
2. datarelationcollection: a set of relations between datatables of dataset. The relationship is expressed by a datarelation object, which associates rows in one able with rows in another datatable.
3. extendedproperties: According to the literal meaning "extended property", you can know that it is used to place custom information. It is used to place information except datatable and datarelation.