高手帮忙看下,修改不出错误,但是不能改数据.
高手帮忙看下,修改不出错误,但是不能改数据.代码如下,protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataSet ds = bc.getdataset("select * from admin where id ='" + Request.QueryString["id"] + "'", "admin");
DataRow[] row = ds.Tables[0].Select();
foreach (DataRow rs in row)
{
TextBox1.Text = rs["username"].ToString();
TextBox2.Text = rs["userpwd"].ToString();
TextBox3.Text = rs["flog"].ToString();
}
}
}
protected void Button1_Click(object sender, EventArgs e)
{
bc.execsql("update admin set username = '" + TextBox1.Text + "',userpwd='" + TextBox2.Text + "',flog='" + TextBox3.Text + "'' where id='" + Request.QueryString["id"] + "'");
Response.Write("<script language=javascript>alert('修改成功!');location.href='list.aspx'</script>");
}
会显示修改成功,但是数据库中的数据就是不发生变化.