日期:2014-05-18  浏览次数:20630 次

程序update 资料后,当资料正确的更新后,怎样写让程序提示"更新成功!"
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();

}




------解决方案--------------------
加句
Response.Write( " <script> alert( '更新成功! ') </script> ");
------解决方案--------------------
楼上的点确定后字体变大了,最好加一个Literal然后

Listeral.Text= " <script> alert( '更新成功! ') </script> ";
------解决方案--------------------
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();

}

------解决方案--------------------
最好还要重定向一下页面,否则你点刷新后就会看到问题了