I have to execute an updating query :
using (SqlCommand sqlCmd = new SqlCommand("UPDATE Test SET Testedpiece = Testedpiece + 1 and Rate = (Testedpiece * 100) / Totalpiece WHERE IDSuperlot = @super", connexion))
But i have this error System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near the keyword 'and'.
I don't know why this error appears and how can i fix it
Your sql command starts like this:
UPDATE Test SET Testedpiece = Testedpiece + 1 and Rate = ...
change it to this:
UPDATE Test SET Testedpiece = Testedpiece + 1, Rate = ...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.