c#代码:
protected void check_click(object sender, EventArgs e)
{
SqlConnection c;
string str = "Data Source =(LocalDB)\\MSSQLLocalDB;";
str += "AttachDbFilename=|DataDirectory|\\DinoData.mdf;";
str += "Integrated Security= True";
c = new SqlConnection(str);
if (Page.IsValid)
{
Session["tit"] = (string)title.Text;
Session["Discrip"] = (string)Discrip.Text;
Session["Doname"] = (string)Dinoname.Text;
Session["wage"] = (string)wage.Text;
Session["lo"] = (string)ddlcountry.SelectedItem.Text;
Session["val"] = (bool)true;
Response.Redirect("Had Manger.aspx", true);
SqlCommand zer = new SqlCommand("UPDATE [User] SET did4 = 0", c);
c.Open();
zer.ExecuteNonQuery();
c.Close();
}
}
没有错误,但没有更新 帮忙 好的,我更新ehis是所有的功能
答案 0 :(得分:0)
在执行查询之前,您正在调用Response.Redirect("Had Manger.aspx", true);
。注释掉或将其移到最后,你应该没问题。
答案 1 :(得分:0)
Response.Redirect(" Had Manger.aspx",true);