Dim i As Integer For i = DataTables("结存数").DataRows.Count-1 To 0 Step -1 Dim dr As DataRow = DataTables("结存数").DataRows(i) Dim dr2 As DataRow = DataTables("结存数").Find("产品名称='" & dr("产品名称") & "' and 包装及产品名称='" & dr("包装及产品名称") & "' and _Identify <> " & dr("_Identify")) If dr2 IsNot Nothing Then dr2.Delete End If Next