Ado. Net Structure-from msdn

Source: Internet
Author: User
Tags types of functions
ArticleDirectory
    • Ado. NET Component
    • Select datareader or Dataset
    • XML and ADO. net

Http://msdn.microsoft.com/zh-cn/library/27y4ybxw (V = vs.80). aspx

 

Only some of them are selected:

Ado. NET Component

You can use two components of ADO. Net to access and process data:

    • . NET Framework data provisionProgram

    • Dataset

. NET Framework data provider

The. NET Framework data provider is a component designed specifically for data processing and quick, read-only access to data. The connection object provides a connection to the data source. The command object allows you to access database commands used to return data, modify data, run stored procedures, and send or retrieve parameter information. Datareader provides high-performance data streams from data sources. Finally, dataadapter provides a bridge between dataset objects and data sources. Dataadapter uses the command object to execute SQL commands in the data source to load data to dataset and make changes to the data in dataset consistent with the data source.

Dataset

Ado. Net dataset is specially designed for data access independent from any data source. Therefore, it can be used for a variety of different data sources, for XML data, or for managing local data of applications. Dataset contains a set of one or more able objects, which are composed of data rows and data columns and primary keys, foreign keys, constraints, and link information related to data in the datatable object.

Describes the relationship between the. NET Framework data provider and dataset.

Ado. net structure-the structure of this graph is clear.

 

 

Select datareader or Dataset

Determine whether the application should use datareader (see use datareader to retrieve data) or dataset (see In ADO. when using dataset), consider the types of functions required by the application. Dataset is used to perform the following functions:

    • The data is cached locally in the application to process the data. If you only need to read the query results, datareader is a better choice.

    • Remote Data Processing at or from the XML Web Service.

    • Dynamic Interaction with data, such as binding to a Windows form control or combining and associating data from multiple sources.

    • A large amount of data is processed without the need to maintain an open connection with the data source, so that the connection is released to other clients.

If you do not need the functions provided by dataset, you can use datareader to return data only in read-only mode to improve the application performance. Although dataadapter uses datareader to populate dataset content (see filling dataset from dataadapter), datareader can be used to improve performance, because it can save the memory used by dataset, it also saves the processing required to create a dataset and fill in its content.

XML and ADO. net

Ado. Net leverages the power of XML to provide disconnected access to data. The Design of ADO. Net goes hand in hand with the design of XML classes in. NET Framework. They are all components of the same structure.

The XML classes in ADO. NET and. NET Framework are concentrated on DataSet objects. Whether the XML source is a file or an XML stream, it can be used to fill the dataset. Regardless of the data source in the dataset, dataset can be written as XML conforming to the W3C standard, and its architecture can be included in the XML Schema Definition Language (XSD) architecture. Because dataset's inherent serialization format is XML, it is an excellent medium for moving data between layers, this makes dataset the best choice for remotely sending data and architecture context to XML Web Services and receiving data and architecture context from XML Web Services.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.