数据库更新语句:
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);
}
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);
}
{
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);
如果是变量的话
字符串 ' " & & " '
数字 " & & "
Response.End();
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楼说的,修改了下,怎么又出现问题,这是什么问题啊。
改成
Content + "' Where Id =" + Id;