public void ShuKaFileUpdate()
{
SqlConnection Con = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["Con"]);
Con.Open();
SqlCommand cmd = new SqlCommand("update nb_EMPLOYEE set BAIBIE='"+this.ddl_sort.SelectedValue.ToString()+"' where employeeid='"+this.tb_emp.Text+"' ",Con);

cmd.ExecuteNonQuery();

Con.Close();

}

解决方案 »

  1.   

    加句
    Response.Write("<script>alert('更新成功!')</script>");
      

  2.   

    楼上的点确定后字体变大了,最好加一个Literal然后Listeral.Text="<script>alert('更新成功!')</script>";
      

  3.   

    public void ShuKaFileUpdate()
    {
    SqlConnection Con = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["Con"]);
    Con.Open();
    SqlCommand cmd = new SqlCommand("update nb_EMPLOYEE set BAIBIE='"+this.ddl_sort.SelectedValue.ToString()+"' where employeeid='"+this.tb_emp.Text+"' ",Con);

    cmd.ExecuteNonQuery();
    Response.Write("<script>alert('更新成功!')</script>"); Con.Close();

    }
      

  4.   

    是要做判定的,还有一个but是用来查询资料的,当查询到这个资料后,才能更新成功.看这句SqlCommand cmd = new SqlCommand("update nb_EMPLOYEE set BAIBIE='"+this.ddl_sort.SelectedValue.ToString()+"' where employeeid='"+this.tb_emp.Text+"' ",Con);