当前位置: 代码迷 >> ASP.NET >> 无法更新到数据库,该怎么处理
  详细解决方案

无法更新到数据库,该怎么处理

热度:5973   发布时间:2013-02-26 00:00:00.0
无法更新到数据库
protected   void   Application_End(object   sender,   EventArgs   e)
        {
                SqlConnection   con   =   DB.createCon();
                con.Open();
                string   strID   =   Request.QueryString[ "WageChinaId "].ToString();
                SqlCommand   cmd   =   new   SqlCommand( "update   WageChina   set   Hits= ' "   +   Application[ "totol "].ToString()   +   " '   where   WageChinaId= ' "   +   strID   +   " ' ",   con);
                cmd.ExecuteNonQuery();
                con.Close();
        }


上面的代码语法上有错误吗?为什么我运行上面的代码后,无法更新到数据库呢?

------解决方案--------------------------------------------------------
没有触发实践。
------解决方案--------------------------------------------------------
Application_End會在程序停止時觸發。你在停止IIS時看看有無觸發。
  相关解决方案