Differences between DTV. Table. Rows. Remove (DR) and Dr. Delete ()

Source: Internet
Author: User

After a datarow object is created, its status is detached, which is an isolated object. Therefore, after datarow is created, the unit in datarow fills in data and then uses datatable. rows. the add (datarow) method adds this datarow to the able. After datarow is added to the able, the status of this datarow is changed to added.

After the datarow is modified, the datarow status changes to modified. after the delete () method deletes datarow, The datarow status changes to deleted. However, this row still exists in the able, but the status changes. In this case, the datatable is used. rows. count to view the number of rows, which is the same as before deletion.

This datarow is removed from the datatable only after the able. Remove (datarow) method is called, and its status also returns to the detached isolated state.

MsdnDescription of datarow. Delete method:If the row rowstate is "added", the row is removed from the table. When the delete method is used, rowstate becomes "deleted ". It remains "deleted" until you call acceptchanges ". You can call rejectchanges to cancel row deletion.

With Delete (), haschanges () of dataset is true;
Remove () is used. haschanges () of dataset is set to false;

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.