如果我没有在类型i前面加上' WHERE ',则会出现'type'错误
string sql = "UPDATE Resource SET " + "location='" + location + "'" + "WHERE levelNo='" + levelNo + "'" + "Type='" + type + "'" + " Abr='"+ abr + "'" + " Description='" + description + "'" + " Capacity='" +capacity +"'" + " Detail='" + detail + "'";
但如果我说它我得到' WHERE '
的错误string sql = "UPDATE Resource SET " + "location='" + location + "'" + "WHERE levelNo='" + levelNo + "'" + "**WHERE** Type='" + type + "'" + " Abr='"+ abr + "'" + " Description='" + description + "'" + " Capacity='" +capacity +"'" + " Detail='" + detail + "'";
答案 0 :(得分:4)
您的附加条件之间需要AND
,而不是其他WHERE
条款
答案 1 :(得分:2)
“WHERE levelNo ='”+ levelNo +“' AND ”+“Type ='”+ type +“'”