我在c#中使用MySql.Data作为mysql连接。在另一个程序工作,但目前我挂在INSERT INTO命令。C#MySql.Data INSERT INTO错误
我得到以下错误:
An unhandled exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll
Additional information: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key) VALUES ('PGJWZBPOWTRPUTKY')' at line 1
有了这个代码:
MySqlCommand Command = Connection.CreateCommand();
MySqlDataReader Reader;
Command.CommandText = "INSERT INTO jt_teamsync (key) VALUES ('" + TeamSyncKey + "')";
Connection.Open();
Reader = Command.ExecuteReader();
Connection.Close();
感谢所有帮助
该错误.. key'也是什么是'一个字段name..if所以为什么不''别名'表名'插入jt_teamsync J(j.key)VALUES(''+ TeamSyncKey +'')“;''例如 – MethodMan 2013-04-05 18:04:01