Dim i As Integer
Dim dr1 As DataRow = DataTables("BOM清单").DataRows(DataTables("BOM清单").DataRows.Count - 1)
Dim dr As DataRow
For i = DataTables("BOM清单").DataRows.Count - 2 To 0 Step - 1
dr = DataTables("BOM清单").DataRows(i)
If dr("母件编码") = dr1("母件编码") AndAlso dr("子件编码") = dr1("子件编码") Then
dr.delete
Else
DataTables("BOM清单").save
DataTables("BOM清单").SQLDeleteFor("母件编码 = '" & dr1("母件编码") & "' And 子件编码 = '" & dr1("子件编码") & "' and _Identify <> " & dr1("_Identify"))
dr1 = dr
End If
Next
DataTables("BOM清单").save
DataTables("BOM清单").SQLDeleteFor("母件编码 = '" & dr1("母件编码") & "' And 子件编码 = '" & dr1("子件编码") & "' and _Identify <> " & dr1("_Identify"))