Dim arys() As String = {"第二列", "第三列"}
For i As Integer = 0 To arys.Length - 1
Dim count = e.DataTable.Compute("count(_Identify)", arys(i) & " = \'" & e.DataRow(arys(i)) & "\'")
If count > 1 Then
msgbox("第" & Tables(e.DataTable.Name).FindRow(e.DataRow) + 1 & "行重复,不能保存!")
e.Cancel = True
Exit For
End If
Next