0

我正在尝试向 mySql db 插入行,但出现此错误。

   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();

谢谢

4

1 回答 1

3

解决它。edmx 文件有问题。所有字段都设置为实体键。

于 2013-01-04T22:18:41.133 回答