Select Case e.DataCol.Name
Case "批号"
Dim Result As DialogResult
With DataTables("商品表")
Dim drs As List(Of DataRow)
drs = .Select("批号 = '" & e.DataRow("批号") & "'")
If drs.count > 1 Then‘如果找到的话
Result=MessageBox.Show("'"& e.DataRow("批号") &"'重复! 共有"& drs.count &"处重复,是否继续录入?", "提示")
If Result = DialogResult.Yes Then
e.DataRow("批号")=" & e.NewValue & "
Else
e.Cancel = True
End If
End If
End With
End Select