-
protected void submit_Click(object sender, EventArgs e)
{
if (text.Text != "")
{if (display.Checked == true) { string nowTime = DateTime.Now.ToString("yyyy-MM-dd"); if (check01.Text == "1") { run.operateData("update notice set text='" + text.Text + "',time='" + nowTime + "',display='1是' where id=" + editID, -1, 0); run.operateData("update notice set display='是' where id=" + editID, -1, 0); Response.Write("<script>alert('修改成功!');window.location = 'noticeManage.aspx';</script>"); check01.Text = "0"; } else { run.operateData("insert into notice (text,time,display) values ('" + text.Text + "','" + nowTime + "','是')", -1, 0); Response.Write("<script>alert('添加成功!');window.location = 'noticeManage.aspx';</script>"); } } else { string nowTime = DateTime.Now.ToString("yyyy-MM-dd"); if (check01.Text == "1") { run.operateData("update notice set text='" + text.Text + "',time='" + nowTime + "',display='0否' where id=" + editID, -1, 0); run.operateData("update notice set text='" + text.Text + "'" +" where id=" + editID, -1, 0); Response.Write("<script>alert('修改成功!');window.location = 'noticeManage.aspx';</script>"); check01.Text = "0"; } else { run.operateData("insert into notice (text,time,display) values ('" + text.Text + "','" + nowTime + "','否')", -1, 0); Response.Write("<script>alert('添加成功!');window.location = 'noticeManage.aspx';</script>"); } } } else Response.Write("<script>alert('通告内容不能为空!')</script>");
}
oprerateDate是操作数据库,那个update的sql语句 点击按钮后 提示修改成功,但是数据库 内容没有改变,也没有报错