Their Primary Keys may collide

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top