DataColChanged
Select Case e.DataCol.name
Case "身份证号码","人员状态"
Dim dr As DataRow = e.DataRow
If dr.IsNull("身份证号码") = False AndAlso dr.IsNull("人员状态") = False Then
If e.DataTable.Compute("Count([_Identify])","身份证号码 = '" & dr("身份证号码") & "' And 人员状态 = '正常'") > 1 Then
MessageBox.Show("已经存在相同身份证号码和人员状态的行!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
e.DataRow(e.DataCol.Name) = e.OldValue '取消输入
End If
End If
End Select