If e.DataCol.Name = "第四列" Then
Dim dr As DataRow
' *** dr = e.DataTable.Find(" 第二列 = '" & e.NewValue & "'and 第三列 = '" & e.NewValue & "' and 第四列 = '" & e.NewValue & "' " )
dr = e.DataTable.Find("第二列 = '" & e.DataRow("第二列") & "'and 第三列 = '" & e.DataRow("第三列") & "' and 第四列 = '" & e.NewValue & "'" )
If dr IsNot Nothing Then
MessageBox.Show("此订单号已经存在!")
e.Cancel = True
End If
End If
比较一下两个 dr = ···
[此贴子已经被作者于2011-2-16 15:33:43编辑过]