Calls the mesh part in the platform. Deletefocusedrow () After iterating through the mesh parts. Datatabel times wrong

Source: Internet
Author: User

' Prompt when accessing a DataTable: Deleted rows cannot be accessedFor each Dr in mesh Part 1. DataTable.Rows
If IsNull (dr["ID"]) Then
showinformation ("ID cannot be empty")
End
End If
Next


as shown in this circular judgment, if the data in the mesh Part 1 has been deleted, that is called: mesh parts. Deletefocusedrow (), then an error is raised: The deleted cannot be accessed on the
workaround, add a judge to determine whether the row was deleted, and access the data in the row:
For each Dr in task relation person. DataTable.Rows
If Dr. Rowstate<>8 Then
If IsNull (dr["Personnel ID"]) Then
showinformation ("Please select all relationship types of the relationship person, do not need to right-click Delete.") ")
End
End If
End If
Next

The RowState attribute of the DR can be judged.
RowState attribute annotations:
//The line has been created but does not belong to any System.Data.DataRowCollection. System.Data.DataRow is immediately in this state when it is created, before it is added to the collection, or after it has been removed from the collection.
Detached = 1,

//The line has not changed since the last Call to System.Data.DataRow.AcceptChanges ().
unchanged = 2,

//The row has been added to System.Data.DataRowCollection, System.Data.DataRow.AcceptChanges () has not been called.
Added = 4,

//The line has been removed through System.Data.DataRow's System.Data.DataRow.Delete () method.
Deleted = 8,

//The line has been modified and System.Data.DataRow.AcceptChanges () has not been called.
Modified = +,

Original address: http://bbs.delit.cn/thread-654-1-1.html reprint Please specify the source: The Author: metric Technology www.Delit. cn

Calls the mesh part in the platform. Deletefocusedrow () After iterating through the mesh parts. Datatabel times wrong

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.