none
Entity Framework 4 and Default Values RRS feed

  • Question

  • I have a column with default value in a table in SQL Server 2008 R2 database as generated by Entity Framework 4 .

    But when updating the table by Linq to Entity, the default value is not set.

    Any idea?

    Thanks,

    Bas

    • Edited by Bas_auc Friday, June 28, 2013 3:42 AM
    Thursday, June 27, 2013 12:48 PM

Answers

  • Hi Bas_auc,

    Are you using Model First or EF4 Code Only development?

    If you are using Model First, you can go to EDM designer. Select the property in designer and modify Default Value in properties window. 

    For Code Only development, you can try to set default value in the constructor of the entities.

    If there are still any problem, could you please upload a demo project to reproduce the problem to SkyDrive?

    Best regards,


    Chester Hong
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

    Friday, June 28, 2013 8:24 AM
    Moderator