Benefits of using Dataset

Source: Internet
Author: User

It is very convenient to use dataset in many cases. The following are some advantages of using Dataset:

1. It is easy to bind with the UI control.

Although you can implement some interfaces (ilist, ilistsource, ibindinglist, and so on) for custom business objects to bind them to controls, it is quite troublesome after all, it is very convenient to use dataset, web form, or window form.

2. Ease of persistence.

Using dataadapter can easily insert, update, and delete data. dataset is a very easy-to-use offline database. dataset can record the following initial values (we can use where statements to retrieve records again ), datarow statuses (insert, update, and delete) are also tracked. For example, we can add a row_update event to synchronize the values of two columns.

3. sorting.

4. Data filtering is supported.

5. You can easily use XSD's to define a strong-type dataset-use the defined XML file to automatically generate a strong-type dataset. This is automatically generatedCodeIt provides great convenience.

6. Calculated field and search field-we can add a field. The value of this field depends on the values of other fields (or even data tables.

7. Good combination with XML.

Dataset provides built-in XML serialization functions, as well as readxml (), writexml () and other methods, providing us with great convenience. For example, we can use WebService to return dataset to the client.

8. relationship. A dataset can contain multiple able data, which can be associated with each other. Select distinct and group by can be used.

9. data verification.

Dataset provides simple verification (such as type, can be empty, maximum length, and uniqueness) in this province. In addition, as mentioned at above, we can also capture changes in rows and columns programmatically (such as row_update) to verify data.

10. Auto-increment columns.

It is also convenient to handle Automatically increasing columns.

11. Other Microsoft products provide excellent support for dataset, such as infopath and BizTalk.

12. Third-party. Net controls also provide good support for dataset.

13. extendedproperty can be used to conveniently add metadata to dataset during runtime and is very easy to use.

14. dataset in. netCommunityIs one of the many technologies discussed and has a wide range of applications.

15. The performance of dataset will be improved in the new version. And whether the performance is low depends on the user's level.

For more information, see here.

whether to use dataset is closely related to the architecture design. Some people prefer dataset, while others prefer custom entities. To clarify the business logic and easily present data on the UI (for example, when o/R Mapping is used, the business entity needs to be transmitted between layers, when the client displays data, it is not convenient to directly bind the business entity to the UI control). Then, you can convert the domain models to the presentation models ), someone wrote such a class library nview, which includes the function of converting business entities to dataset.
related links:
using stronugly typed objects and collections to replace dataset's in your. net Applications
choosing data containers. net
layered ubuntures & transactions-why does it have to hurt so much?
debunking dataset myth
the law of leaky category actions

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.