2
这是我收到的错误:实体框架,MySQL和调用SaveChanges - 在SQL语法错误
Server Error in '/' Application.
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 'group) VALUES ('test_user','testpass',13,77,0,0,0,1);SE' at line 9
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: MySql.Data.MySqlClient.MySqlException: 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 'group) VALUES ('test_user', 'testpass', 13, 77, 0, 0, 0, 1); SE' at line 9
我身边有一个外观和某人的解释,这可能与MySQL的缓冲SELECT is stripped which may indicate some string buffer problems in the MySql drive
我使用的MySQL连接器版本6.5.4.0
任何帮助表示赞赏感谢
按照要求,这是我使用插入代码:
public bool CreateMember(string username, string password, int age, int residence)
{
Context.Members.AddObject(new MemberEntity { Username = username, Password = password, Age = age, Residence = residence, Banned = false, Locked = false, Online = false, Group = 1 });
return Context.SaveChanges() > 0;
}
错误消息告诉您确切的原因:语法错误。请发布您执行的SQL。 – usr
我将代码添加到主页 –