MySqlHelper
// 执行带参数的SQL增删改语句 /// SQL增删改语句 /// 参数集合 /// 返回更新的记录数 public int ExecuteNonQuery(string sql, params MySqlParameter[] args) { int res; using (comm = new MySqlCommand(sql, GetConn())) { comm.Parameters.AddRange(parms); res = comm.ExecuteNonQuery(); } return res; }
update
MySqlParameter[] args = new MySqlParameter[] { new MySqlParameter("@height", Request.Form["height"]), new MySqlParameter("@weight", Request.Form["weight"]) };var sql = "update status set [email protected],[email protected] where code =2";
db.ExecuteNonQuery(sql,args);
时间: 2024-10-11 12:59:00