更新carstock设置nofstock INCREMENT BY 1,其中和cid =“ + TextBox1.Text;
答案 0 :(得分:0)
嗯,你可能想要这个:
“更新carstock集nofstock = nofstock +1,其中cid = @ cid”
由于您的示例对于SQL注入并不安全,因此最好使用SQL参数。
答案 1 :(得分:0)
update carstock set nofstock INCREMENT BY 1 where some_field="some_condition" and cid=" + TextBox1.Text";
您要么错过了一项条件,要么误把了where
。