Delete * from table1 where ID =如何添加数组?(vb.net2008)
本帖最后由 pengwei0417 于 2013-04-03 13:15:18 编辑 如题,使用vb.net 要删除的ID保存在数组中IDstr(),想使用一条语句将数中ID的数组删除,该如何写。
dim commandstr as string="Delete * from table1 where ID in ??????"
[解决办法]
dim strID as string string.Join(",", IDstr)
dim commandstr as string="Delete * from table1 where ID in ( " + strID + ")"
[解决办法]
commandstr = "delete from table1 where id in (";
commandstr = commandstr + string.join(",",idstr)+arrs +")";
执行sql语句