Dim ld As IntegerDim cmd As New SQLCommandcmd.CommandText = "Select Count(*) From {订单} Where 产品 = 'PD01'"ld = cmd.ExecuteScalar()
if ld > 0 then
Messagebox.show("已经存在pd01")
end if