Error 1064 Insert Statement Using MySQL Parameters In C#
Good evening!
The code above has a database field called desc which is a reserved word in SQL as an order by criteria.
The solution is to enclose the field name desc with an acute or back quote. as shown in the code below:
Cheers!
The code above has a database field called desc which is a reserved word in SQL as an order by criteria.
dbQuery = String.Format(@"INSERT INTO accom_temp_hotelagencies(hotel_id, agency_id, hotel_webid, desc)VALUES(?HotelId, ?AgencyId, ?HotelWebId, ?Description)");
dbQuery = String.Format(@"INSERT INTO accom_temp_hotelagencies(hotel_id, agency_id, hotel_webid, `desc`)VALUES(?HotelId, ?AgencyId, ?HotelWebId, ?Description)");
Comments
Post a Comment