Simon Brangwin said:jh71283 said:*snip*Any progress on this? I'm having the same problem now.
I have a couple of tables, Employees and SecurityClearance. There are no relationships defined in the SQL Server database. They both have composite keys and I get this error when creating an association between the two.
Error 1 Error 111: Properties referred by the Principal Role DLPSSECL must be exactly identical to the key of the EntityType Model.DLPSSECL referred to by the Principal Role in the relationship constraint for Relationship Model.DLPSSECLDLEPEM. Make sure all the key properties are specified in the Principal Role. C:\Documents and Settings\simonb\My Documents\Visual Studio 10\Projects\WpfApplication1\WpfApplication1\Model1.edmx 1 1 WpfApplication1
Properties referred by the Principal Role SecurityClearance must be exactly identical to the key of the EntityType Model. SecurityClearance referred to by the Principal Role in the relationship constraint for Relationship Model. SecurityClearanceEmployee. Make sure all the key properties are specified in the Principal Role.
EmployeeCompanyID (Int16) PKEmployeeID (Int32) PKSecurityClearance (string)Other data fields...SecurityClearanceCompanyID (Int16) PKSecurityClearance (string) PKOther data fields...
Association is between SecurityClearance and Employee (1 to Many).
Mappings:
Maps to EmployeeSecurityClearance:CompanyID : Int16 <-> CopmanyID : smallint (key field on Employee table)SecurityClearance : String <->SecurityClearance : char (data field on Employee table)EmployeeCompanyID : Int16 <-> CopmanyID : smallint (key field on Emlpoyee table)EmployeeID : Int32 <-> EmployeeID : int (key field on Employee table)
Is creating an association in the EDMX on composite keyed tables like this supported? I've tried it in both EF v3.5 and EF v4.0 in the VS2010 beta and get the same error message when running model validation.
Cheers,
Simon
I have the exact same problem. it doesn't appear entity framework likes composite keys. very frustrating.