If e.DataCol.Name = "逻辑列名" Then Dim dr As DataRow =Dim dr As DataRow = DataTables("表B").Find("产品编号 = '" & e.DataRow("产品编号") & "'") If e.DataRow("逻辑列名") = True Then If dr Is Nothing Then dr = DataTables("表B").AddNew() For Each dc As DataCol In DataTables("表B").DataCols dr(dc.Name) = e.DataRow(dc.Name) Next End If Else If dr IsNot Nothing Then dr.Delete() End If End If End If