-6

タイプの前に「 WHERE 」を付けないと、「タイプ」のエラーが発生します

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 + "'";
4

2 に答える 2

4

追加の句ANDではなく、追加の条件の間に sが必要ですWHERE

于 2013-06-06T16:50:54.673 に答える
2

"WHERE levelNo='" + levelNo + "' AND " + "Type='" + type + "'"

于 2013-06-06T16:51:16.173 に答える