数据库更新语句:
 public void Update()
    {
        strSQL = "Update Games SET GameName='" + GameName + "', TypeId=" + TypeId.ToString()+ ",TyId='" + TyID.ToString() + "', DownTimes='" + DowTimes + "',GameSize='" + GameSize + "', GameType=" + GameType + ", RunningEnv='" + RunningEnv+ "',AccreditWay=" + AccreditWay + ", PublishDate=" + PublishDate + ", DownloadAddr='" + DownloadAddr + "', ImageFile=" + ImageFile + ", Content="+ Content + "Where Id =" + Id;
        SqlExecuteNonQuery(strSQL);
       
    }

解决方案 »

  1.   

     public void Update()
       {
       strSQL = "Update Games SET GameName='" + GameName + "', TypeId=" + TypeId.ToString()+ ",TyId='" + TyID.ToString() + "', DownTimes='" + DowTimes + "',GameSize='" + GameSize + "', GameType=" + GameType + ", RunningEnv='" + RunningEnv+ "',AccreditWay=" + AccreditWay + ", PublishDate=" + PublishDate + ", DownloadAddr='" + DownloadAddr + "', ImageFile=" + ImageFile + ", Content="+ Content + " Where Id =" + Id;
    MessageBox.Show(strSQL); //看合成后的字串是否正确
       SqlExecuteNonQuery(strSQL);
     
      

  2.   

    字符串用单引号,数字不用任何引号,
    如果是变量的话
    字符串  ' " &  & " '
    数字   " & & "
      

  3.   

    怎么加了MessageBox.Show(strSQL); //看合成后的字串是否正确这个后,显示“错误当前上下文中不存在名称“MessageBox””
      

  4.   

                Response.Write(strSQL);
                Response.End();
      

  5.   

    我修改成
     public void Update()
        {
            strSQL = "Update Games SET GameName='" + GameName + "', TypeId='" + TypeId.ToString() + "',TyId='" + TyID.ToString() + "', DownTimes='" + DowTimes.ToString() + "',GameSize='" + GameSize + "', GameType='" + GameType + "', RunningEnv='" + RunningEnv + "',AccreditWay='" + AccreditWay + "', PublishDate='" + PublishDate + "', DownloadAddr='" + DownloadAddr + "', ImageFile='" + ImageFile + "', Content='" + Content + "'Where Id =" + Id;
            SqlExecuteNonQuery(strSQL);
           
        }后换成显示“列名 'DownTimes' 无效。”
    就按3楼说的,修改了下,怎么又出现问题,这是什么问题啊。
      

  6.   

     Content + "'Where Id =" + Id;
    改成
    Content + "' Where Id =" + Id;
     
     
      

  7.   

    DowTimes.ToString("yyyy-MM-dd HH:mm:ss") 
      

  8.   

    那个DowTimes是下载次数,是int型的
      

  9.   

    DownTimes 与数据库中的字段名一至否
      

  10.   

    好了。感谢啊。是DownTimes 与数据库中的字段名不一至