If e.DataCol.Name = "订单号" Then Dim dr As DataRow dr = e.DataTable.Find("订单号 = '" & e.NewValue & "'") If dr IsNot Nothing Then MessageBox.Show("此订单号已经存在!") e.Cancel = True End If End If