怎么写关于“IN”操作符的SQL语句的参数化命令

2025-05-05 21:01:39
推荐回答(1个)
回答1:

for (int i = 0; i < temp.Length; i++){sb.Append(temp[i]);}comm.CommandText = sb.ToString();}}if (comm.Connection.State != ConnectionState.Open){comm.Connection.Open();}return comm.ExecuteReader(CommandBehavior.CloseConnection);}调用的时候类似:ExecuteReaderParams(comm, "select * from xx where id=? and name=?",id,name);