sql_str = "Update orders Set orderState = @orderState where ono in (" + Request.Form["ono"] + ")";报错:列名 'RT110810100459' 无效。
列名 'RT110813163011' 无效。
字段ono是VarChar不是Int ,难道in 只能用于数字不能是字符串吗?
列名 'RT110813163011' 无效。
字段ono是VarChar不是Int ,难道in 只能用于数字不能是字符串吗?
select * from tb where col in (1,2,3,4,5,6)
字符
select * from tb where col in ('1','2','3','4')这样-----
你 Request.Form["ono"] 里面的值是什么样的,印出来看看
RT110902210613
RT110901160455
RT110822213653
RT110810100222
....
必须把字符串sql弄成这个样子
才能正确执行
String a = Request.Form["ono"] ;
a = a.Replace("\r\n", "','");
a = "'" + a + "'";sql_str = "Update orders Set orderState = @orderState where ono in (" +a+ ")";