none
Update Entity Model from Database in edmx RRS feed

  • Question

  • Dear All

    Thank you for your attention.

    I would like to know the easy way to modify the edmx after changes of database.

    e.g. I modified a order table 's primary key from OrderNumber to ID
    and so the foreign key constraint to another table is also changed from OrderNumber to ID

    then open existing edmx and  'Update Model from Database'.

    The tables are changed but there are errors

    Error 1 Error 111: Properties referred by the Principal Role t1 must be exactly identical to the key of the EntityType Model.t1 referred to by the Principal Role in the relationship constraint for Relationship Model.FK_t2_t11. Make sure all the key properties are specified in the Principal Role.

    and two relations exists

    How to modify the current edmx to let it works?

    Thanks


    Best Regards
    mintssoul

    Saturday, April 11, 2015 3:21 AM

Answers

  • Hello mintssoul,

    >>I would like to know the easy way to modify the edmx after changes of database.

    I suggest you could firstly delete these modified entities in the design window(it will delete these type definition in emdx file) and then use Update Model from Database command to re-generate these entities.

    Regards,

    Fred.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by mintssoul Tuesday, April 14, 2015 12:57 AM
    Monday, April 13, 2015 11:13 AM
    Moderator

All replies

  • Hello mintssoul,

    >>I would like to know the easy way to modify the edmx after changes of database.

    I suggest you could firstly delete these modified entities in the design window(it will delete these type definition in emdx file) and then use Update Model from Database command to re-generate these entities.

    Regards,

    Fred.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by mintssoul Tuesday, April 14, 2015 12:57 AM
    Monday, April 13, 2015 11:13 AM
    Moderator
  • Dear Fred

    Thank you.

    I tried, it works! thanks.



    Best Regards
    mintssoul

    Tuesday, April 14, 2015 12:57 AM