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 IfEnd If
我在datarowchanging那里写了这段代码,当出厂编号列不为空,当进行复制当前行时,出现系统自动退出,请问什么问题?