我正在尝试将行插入到mySql数据库中,并且出现此错误。

   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 '(SELECT
 `groups_users`.`groupID`,
 `groups_u' at line 1


该代码是

        groups_users ug = new groups_users();
        ug.groupID = 1;
        ug.userID = 1;
        ug.isDeleted = false;
        ug.created = DateTime.Now;
        ctx.groups_users.Add(ug);

        ctx.SaveChanges();


谢谢

最佳答案

固定它。
edmx文件中有问题。所有字段均设置为实体键。

10-04 15:37