如何解决有关错误3034的edmx图表的问题? [英] How to resolve a issue regarding edmx diagram with error 3034?

查看:97
本文介绍了如何解决有关错误3034的edmx图表的问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Erroe:3034-从第4300行,第4327行开始映射片段时出现问题:具有可能不同键的两个实体映射到同一行。确保这两个映射片段将AssociationSet的两端映射到相应的列



我尝试过:



i尝试使用新添加的列更新单个表,但是沿着该表还有一些表也会更新,我也尝试生成新的edmx但问题仍然存在。

Erroe:3034-Problem in mapping fragments starting at lines 4300, 4327:Two entities with possibly different keys are mapped to the same row. Ensure these two mapping fragments map both ends of the AssociationSet to the corresponding columns

What I have tried:

i am trying to update a single table with newly added column but along that table there are some table are also get updated and i also tried by generating a new edmx but problem remains.

推荐答案

您好,



表之间可能存在多对多关系,更新导致此错误VS.您可以为表创建一个视图并使用它。这应该有所帮助。通过从Designer中删除模型并尝试再次添加来尝试解析之后尝试此操作。

请按照此处:

sql - 具有可能不同键的两个实体映射到同一行 [ ^ ]

另一篇不错的文章:

Entity Framework:涉及多对多关系表的查询 [ ^ ]



谢谢
Hello,

There might be a Many to Many relationship between the tables, for which the update causes this error in VS. You can create a view might be for the table and use that. That should help. Try this after you have tried resolving by deleting the model from Designer and tried adding again.
Follow here:
sql - Two entities with possibly different keys are mapped to the same row[^]
Another nice article on this:
Entity Framework: Queries involving many to many relationship tables[^]

Thanks


我找到了解决方案通过在只包含两个外键的联结表中添加一个额外的列。

示例:



表1

column1:id

column2:name



表2 帐户

column1:id

column2:number



表3 Person_Account

column1: personId

column2:AccountId

column3:id

中添加额外列 id 作为主键people_Account 表格,问题将解决。



谢谢。
I find out the solution by adding a extra column in a junction table which contain only two foreign key.
Example:

Table1: Person
column1:id
column2:name

Table2:Accounts
column1:id
column2:number

Table3:Person_Account
column1:personId
column2:AccountId
column3:id
add extra column id as a primary key in people_Account table and the problem will be solve.

Thanks.


这篇关于如何解决有关错误3034的edmx图表的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆