Dataset, datatable, and recordset

Source: Internet
Author: User
Dataset, datatable, and recordset
Recordset object ., ADO. net does not directly correspond to it. the closest is the datatable object. although they have almost the same functions, they play different roles in their respective frameworks.
Recordset is a very large object with most ADO functions, but it is still lacking in some aspects. recordset has excellent performance in some aspects, such as: It is creative, it can be operated offline, and has many features, but still needs to be improved in some aspects, such as: Based on its inherent com features, recordset is difficult to attach on the network; recordset is a binary object, so modules on different platforms are difficult to share it; And snakes cannot pass through the firewall. in addition, it represents a single record table. if the table is the result of one or several joins, it is difficult to update the original Code Source. When you try to unify the off-line recordset with the original code source, the data source must be able to identify the SQL. In any case, your recordset can be provided by non-SQL Program Create. in ADO. net, all the functions of ADO recordset are split into several simpler objects: one is datareader. datareader simulates fast, read-only, and only forward read-only cursor operations. datatable represents the data source and is a simple object. you can manually construct a able or use the dataset command to automatically generate a datatable. dataset does not know much about the data it contains. it allows you to process data in the memory, or other tasks such as sorting, editing, filtering, and creating browsing. A DataSet object is a data container class that implements ADO.. Net key object for data extraction. dataset aggregates one or more able objects. datatable exposes its own content through a common set such as a row or column. when you try to read data from a data table, you may be passing through two different layers: ableablemapping and dataview. the datatablemapping object contains Data columns in the data source and datating relationships between able objects. This class is used for datasetcommand objects when dataset is filled. It maintains links between Abstract columns in the dataset and physical columns in the data source. The table view is implemented through the dataview object. It indicates the custom view of the datatable and can be bound to a specific control (such as a data grid in a Windows form or a Web form. This object is equivalent to the implementation of the SQL create view statement in memory. All tables in dataset can be associated with each other through a public domain. the relationships between them are managed by the datarelation object. this is like the formation of ADO data, but there is still the biggest difference. in datarelation, you do not need to use data to form a language, but also have flexible organizational structures. through ADO. net navigation model, you can easily move from the primary row in a table to all its child rows.
Datarelation object is about the implementation of the join statement in the memory. It can be used to establish a parent/child relationship with the same data type ,. once a link is established, any modification that damages the link is forbidden. views and relations are two methods to complete the master/detail architecture. remember that view is only a mask loaded on the record, but relation is a dynamic link between several columns. In relation, you cannot change the order or set conditions. if your code requires a one-to-one foreign key relationship and changes data, it is best not to use the join command. if you need additional filtering functions, You can seek ADO.. Net custom views.

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.