If e.DataCol.Name = "品名" Or e.DataCol.Name = "型号规格" Then Dim dr As DataRow dr = DataTables("订单").Find("品名 = '" & e.DataRow("品名") & "' And 型号规格 = '" & e.DataRow("型号规格") & "'") If dr IsNot Nothing Then MessageBox.Show("此订单号已经存在!") e.Cancel = True End If End If