If e.DataCol.Name = "比率" Then If e.NewValue IsNot Nothing Then Dim dr As DataRow dr = e.DataTable.Find("货品编号 = '" & e.DataRow("货品编号") & "' And 比率 = " & e.NewValue ) If dr IsNot Nothing Then MessageBox.Show("比率不能重复!") e.Cancel = True End If End If End If