Association end is not mapped in ADO entity framework

ado.net entity-framework vb.net visual-studio-2008

Question

I am just starting out with ADO.net Entity Framework I have mapped two tables together and receive the following error:

Error   1   Error 11010: Association End 'OperatorAccess' is not mapped.    E:\Visual Studio\projects\Brandi II\Brandi II\Hospitals.edmx    390 11  Brandi II

Not sure what it is I am doing wrong

Accepted Answer

The Entity Framework designer is terrible - I've had the same problem many times (and your problem too, Craig):

This happens when you have a many-to-one association which is improperly setup. They could very easily fix the designer to make this process simple; but instead, we have to put up with this crap.


To fix:

  • Click on the association, and go to the mapping details view.
  • Under association, click on Maps to <tablename>. Choose the table(s) which make up the many side of the relationship (ie. the table(s) which make up the *-side of the association in the designer)
  • Under Column, choose the table-columns which map to each entity-side Property. You get this error when one of those entries are blank.

Popular Answer

I had the exact same problem and this is what I did to fix it.

Make sure you have an Entity Key set in your designer on the tables your making an association with. Also check that StoreGeneratedPattern is set to Identity for that Entity Key.



Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why