……If spmc >= "" AndAlso ggxh >= "" Then
Dim dr As DataRow = e.DataRow
If e.DataTable.Find("商品名称 = '" & spmc & "' And 规格型号 = '" & ggxh & "'") IsNot Nothing Then
MessageBox.Show("已经存在相同商品名称和规格型号的商品!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
e.Cancel = True
End If
ElseIf ggxh = ""
Dim dr As DataRow = e.DataRow
If e.DataTable.Find("商品名称 = '" & spmc & "'") IsNot Nothing Then
MessageBox.Show("已经存在相同商品名称的商品!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
e.Cancel = True
End If
End If
……