protected void saveBtn_Click(object sender, EventArgs e) { if (IsPostBack) { int intId = Int32.Parse(Request.QueryString["intId"]); Base sa = new Base(); String sql; string content1; content1 = content.Value; sql = "update JOLE_webSite set content = @content where Id =" + intId; String[,] ds = new String[1, 4]; ds[0, 0] = "@content"; //参数 ds[0, 1] = content1; //内容 ds[0, 2] = "2"; //类型 ds[0, 3] = "4000"; //大小 sa.ExecutePrem(sql, ds); showMessage("修改成功",Request.UrlReferrer.ToString()); } else { Response.Write("操作错误。"); Response.End(); } }
public void setInfo(int id,string str) { Base sd = new Base(); string sql = "update JOLE_webSite set content = @content where id = @id"; string [,] ds = new string[2,4]; ds[1, 0] = "@id"; ds[1, 1] = id.ToString(); ds[1, 2] = "1"; ds[1, 3] = "4"; ds[0, 0] = "@content"; //参数 ds[0, 1] = str; //内容 ds[0, 2] = "2"; //类型 ds[0, 3] = "4000"; //大小 sd.ExecutePrem(sql,ds); }