刚才在
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 宿舍 = '" & dr("宿舍") & "'") > 1 Then
MessageBox.Show("已经存在相同楼号和宿舍的行!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
e.DataRow(e.DataCol.Name) = e.OldValue '取消输入
End If
End If
End Select
此主题相关图片如下:360截图20200709170116846.jpg

进入后点击确定,自动退出
[此贴子已经被作者于2020/7/9 17:07:42编辑过]