ADO. NET -- DataSet

Source: Internet
Author: User

The core of the ADO. NET Component-Based Development database application, which provides the class required to connect to the data storage and retrieve, operate, and update data. ADO. NET has many components that are implemented in the System. Data namespace. ADO is the abbreviation of ActiveX Data Objects. It is the predecessor of ADO. NET .. NETFramework is the main data access technology of Microsoft. One design goal of ADO. NET is to be closely related to ADO as much as possible, so that developers can use existing ADO knowledge to quickly master ADO. NET. The following is a summary of ADO. NET. DataSet is developed to facilitate data processing. It is a collection of data. To solve DataReader defects, DataReader can process data quickly, but it is read-only. Once it is moved to the next row, the data of a row cannot be viewed, and DataSet can freely move the pointer. DataSet is an independent data set that can be used to instantly disconnect data or shut down databases. DataSet class is a very important core member of ADO. NET. It is the cache mapped to data in the database on the local computer. Any operations on DataSet are completed in the computer cache. For any data source, it provides a consistent relational programming model. In DataSet, the constraints and relationships between data tables are defined, and data in the data table can be sorted. DataSet features 1. Independence. DataSet is independent of various data sources. In. NET, it provides consistent relational programming models regardless of the type of data source, which is DataSet. 2. offline and connection. DataSet can be used to operate the data in the database in both offline and practical ways. This is a bit like the RecordSet In ADO. 3. the DataSet object is a data view that can be expressed in XML format. It is a data relationship view. DataSet objects and XML documents are almost interchangeable. 1. fill data in the database with the DataAdapter object in DataSet. 2. update the database using the DataAdapter object in DataSet. 3. Update the XML data stream or text. load data to DataSet. The difference between DataSet and RecordSet is that RecordSet can operate databases offline, featuring excellent performance and high efficiency. DataSet is much more complex than RecordSet. Each DataSet is a set of one or more able objects, these objects consist of data rows and columns, as well as primary keys, foreign keys, constraints, and data relationship information in the DataTable object. RecordSet can only store a single data table, although this data table can be generated by joining several data tables. So sometimes, RecordSet is more similar to the able in DataSet. Difference between DataSet and DataReader 1. Non-connection-oriented connection to database when connecting to DataSet. Read all the tables to the SQL Buffer Pool and disconnect them from the database. DataReader is connected to the database. When reading a table, you can only read the table forward. After reading the data, the user decides whether to disconnect the table. 2. Data processing speed: DataSet reads data and processes data slowly. DataReader reads data and processes data quickly. 3. After updating the data in the DataSet, you can update the data back to the original database. After updating the data in the DataReader, there is no way to update the database. 4. Supports paging and dynamic sorting in DataSet. DataReader does not support paging or dynamic sorting. 5. DataSet occupies a large amount of memory on the IIS server. DataReader uses less memory.

Related Article

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.