首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

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

2012-01-07 
无法更新到数据库protectedvoidApplication_End(objectsender,EventArgse){SqlConnectionconDB.createCon

无法更新到数据库
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時看看有無觸發。

热点排行
Bad Request.