类似: if((执行 select count(id) from table where 条件)>0){ 执行 update table set xxx=xxx+1 where 条件 } else { 执行 insert into table(col1,col2) values(1,1) }
if(ado.ExecuteNonQuery( update table set num=num+1 where productid=xxx)==0) { ado.Insert }
var 商品=获取商品(传过来的id); if(购物车.包含(商品)) { 购物车[商品].数量+=1; } else { 购物车.添加(商品); }
110,533
社区成员
642,574
社区内容
加载中
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧