Difference between typed dataset and non-Typed Dataset.

Source: Internet
Author: User

 


Are you talking about typed dataset and untyped dataset?
Typed Dataset is derived from dataset. It generates a dataset Based on the predefined data schema and imposes a strong type constraint on fields in the dataset. You can see through the CS file it generates many methods to encapsulate the datatable operation, so that you can access the field through mydataset. mytable. Field, instead of like Dataset:
Mydataset. tables ["tablename"] ["field"]; Simplifies programming and is not prone to errors. Imagine that if the field name is misspelled in "field", the compiler will not check it, you don't need to use Typed Dataset. If you write an error in field, you will be able to understand it immediately.
In addition, if you include multiple datasets in the typed dataset and establish relationships and constraints on these datasets in the XSD, the type dataset generates methods to reflect these relationships and constraints. If untyped dataset is used, you need to do it yourself.
Performance Considerations: Although Typed Dataset requires more time and space to create an object instance than untypede dataset, It is faster than untyped dataset in data filling, this is because dataadapter already knows how to fill a Typed Dataset. In contrast, dataset needs to read the database twice. For the first time, the structure information of the table in the database is obtained, and the second time the data is fill.
Defects of typed dataset compared with Dataset: in addition to the overhead of creation, typed dataset is not as flexible as dataset, because once the typed dataset is determined, the structure of the data table is fixed. to modify the data table, it must be regenerated.
You can operate dataset at any time as needed (such as adding or deleting fields ).

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.