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
我將代碼添加到主頁 –