EF4 The Relationship could not be changed RRS feed

  • Question

  • I have an PO Table and Vendor Table. PO has VendorId, which is a lookup reference. And in my Model.edmx file, the relationship is showing as VENDOR(1) PO(*). But when i delete a PO, the EF is throwing the following error, The relationship could not be changed because one or more of the foreign key properties is non nullable. When a change is made to a relationship, the related foreign key property is set to null value...

    The VendorId in the PO Table is just only a lookup reference. When i delete a PO, it is nothing to do with Vendor Table. And I have set my Foreign Key FK_PO_VENDOR update rule and delete rule to no action.

    I cant figure out what i am doing wrong, any pointers is highly appreciated


    Tuesday, March 1, 2011 6:46 PM