
关键词“where”附近有语法错误 5
publicstaticintUpdate(Model.productinfo){StringBuilderstrSql=newStringBuilder();strSq...
public static int Update(Model.product info)
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update Product set ");
strSql.Append(" FenLeiId = '" + info.FenLeiId + "',");
strSql.Append(" FenLeiName = '" + info.FenLeiName + "',");
strSql.Append(" ProductName = '" + info.ProductName + "',");
strSql.Append(" sImg = '" + info.sImg + "',");
strSql.Append(" Content = '" + info.Content + "',");
strSql.Append(" where id=" + info.Id);
return DBConn.DB.ExecuteSql(strSql.ToString());
}
#endregion 展开
{
StringBuilder strSql = new StringBuilder();
strSql.Append("update Product set ");
strSql.Append(" FenLeiId = '" + info.FenLeiId + "',");
strSql.Append(" FenLeiName = '" + info.FenLeiName + "',");
strSql.Append(" ProductName = '" + info.ProductName + "',");
strSql.Append(" sImg = '" + info.sImg + "',");
strSql.Append(" Content = '" + info.Content + "',");
strSql.Append(" where id=" + info.Id);
return DBConn.DB.ExecuteSql(strSql.ToString());
}
#endregion 展开
展开全部
set后要写上把什么字段值设置为什么,例如: update 学生表 set 奖学金=2000 where(班编号='1001' and 奖学金=1000)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询