简体   繁体   English

INSERT失败:VB.net中的MySql语法出错

[英]INSERT Failed: Error in MySql syntax in VB.net

I have a transaction procedure like this: 我有这样的交易程序:

  INSERT INTO transaction(out, taxi_no, driver_name, odometer, date, mileage_out, hours_rent, remittance, total, shortage) VALUES (@out, @taxiNO, @drivername, @odometer, @date, @mout, @hours, @remittance, @total, @shortage)

You have an error in your SQL syntax; 您的SQL语法有错误; check the manual that corresponds to your MySQL server version for the right syntax to use near 'out, taxi_no, driver_name, odometer, date, mileage_out, hours_rent, remittance, ' at line 1 查看与您的MySQL服务器版本对应的手册,以便在第1行“out,taxi_no,driver_name,里程表,日期,mileage_out,hours_rent,汇款”附近使用正确的语法

I just copied the syntax and just change the values from my other project, it works well on my other project but when i tried to run the application, it gives me the error. 我只是复制了语法,只是更改了我的其他项目中的值,它在我的其他项目中运行良好,但是当我尝试运行应用程序时,它给了我错误。

out是MySQL中的关键字,请添加backtick即`回quote`

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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