简体   繁体   中英

The select statement includes a reserved word c#

i have problem in my c# application, it was used MYSQL database and no problem where !, but when i change the database to MS access this problem appear: The select statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect.

and this is my code:

OleDbCommand cmd = new OleDbCommand("SELECT action.info, relation.id AS action FROM relation LEFT OUTER JOIN conditions ON relation.conditions_id = conditions.id LEFT OUTER JOIN situation ON relation.situation_id = situation.id LEFT OUTER JOIN car_type ON relation.car_id = car_type.id LEFT OUTER JOIN action ON relation.action_id = action.id LEFT OUTER JOIN signal AS signaal1 ON relation.signal_id = signaal1.id where car_type.info=@car_type" + string2 + "  ORDER BY conditions.id ASC", objConn);
            cmd.Parameters.AddWithValue("@car_type", radButton1.Text);

            OleDbDataReader dataReader = cmd.ExecuteReader();

the error appear when last line executed..! "OleDbDataReader dataReader = cmd.ExecuteReader();"

-------------------------------------EDITED I changed tables names by adding 'z' to tables names, and now another message appear:

在此处输入图片说明

谢谢@Grant_Winney,我更改了动作和关系,错误消失了:D但另一个出现了:s(我问了另一个问题)

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM