这段修改没出错,但是就是不能修改??
怎么我的这段修改没出错,但是就是不能修改呢?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>");
}
点 修改之后可以把数据库中的数据显示到表单里面
也会显示修改成功,但是数据根本没有发生修改.