Their Primary Keys may collide

  • Thread starter Thread starter Tristan MSDN Keen
  • Start date Start date
T

Tristan MSDN Keen

Hi,
Using the Entity Framework, I'm trying to create two models based on the
same table (tblUser), but get the following error when building the project:

Error 1 Error 3033: Problem in Mapping Fragment starting at line 5997:
EntitySets 'tblUser' and 'tblUserSecurity2Set' are both mapped to table
'tblUser'. Their Primary Keys may collide.

Could someone explain me what's wrong (and why) and how to fix that problem?
Thanks in advance.

-----
Extra information:
FYI, despite the error message, it does compile successfully (very
confusing!), but it throws an exception at run time:

Exception:
System.Data.EntityCommandCompilationException: An error occurred while
preparing the command definition. See the inner exception for details.

Inner Exception:
System.Data.MappingException: dbOnDemandEntities.msl(813,10) : error 3033:
Problem in Mapping Fragment starting at line 813: EntitySets 'tblUser' and
'tblUserSecurity2Set' are both mapped to table 'tblUser'. Their Primary Keys
may collide.
 
Back
Top