Select Case e.DataCol.Name Case "货物名称","牌号","规格型号" Dim dr As DataRow dr = e.DataTable.Find("规格型号 = '" & e.NewValue & "'" And "货物名称 = '" & e.NewValue & "'" And "牌号 = '" & e.NewValue & "'" ) If dr IsNot Nothing Then MessageBox.Show("此货物名称已经存在!") e.Cancel = True End If End Select