string sql = "update Teacher set TName = '" + TextBox1.Text + "'," +
"TSex = '" + DropDownList1.SelectedItem.Text + "'," +
"Tage = '" + TextBox7.Text + "'," +
"TPhone = '" + TextBox3.Text + "'," +
"TMail = '" + TextBox4.Text + "'" +
"where TId = '" + Session["Id"] + "'";
DBExec db = new DBExec();
if (db.ExecGetBoolen(sql))
Response.Write("<script>alert('修改成功')</script>");
else
Response.Write("<script>alert('修改失败')</script>");希望对数据库更新,但就是更新不了~~~为什么啊?
"TSex = '" + DropDownList1.SelectedItem.Text + "'," +
"Tage = '" + TextBox7.Text + "'," +
"TPhone = '" + TextBox3.Text + "'," +
"TMail = '" + TextBox4.Text + "'" +
"where TId = '" + Session["Id"] + "'";
DBExec db = new DBExec();
if (db.ExecGetBoolen(sql))
Response.Write("<script>alert('修改成功')</script>");
else
Response.Write("<script>alert('修改失败')</script>");希望对数据库更新,但就是更新不了~~~为什么啊?
太危险啦!!同时检查字段有没有不为空的,
页面数据是否取到拉,
数据类型有没有对上等等