Select Case e.DataCol.name
Case "编号_批次", "编号_序列"
Dim dr As DataRow = e.DataRow
If dr.IsNull("编号_批次") = False AndAlso dr.IsNull("编号_序列") = False Then
For Each s As String In dr("编号_序列").split(",")
If s > "" Then
If e.DataTable.Compute("Count([_Identify])", "编号_批次 = \'" & dr("编号_批次") & "\' And 编号_序列 like \'%" & s & "%\'") > 1 Then
MessageBox.Show("已经存在相同子编号,请仔细核对产品子编号!", "友情提示", MessageBoxButtons.OK, MessageBoxIcon.Information)
e.DataRow(e.DataCol.Name) = e.OldValue \'取消输入
Exit For
End If
End If
Next
End If
End Select