locked
Default value must be provided? RRS feed

  • Question

  • Im trying to create a new record with AddObject.... and SaveChanges.

    There is a DateTime column with a default value.

    If I provide a default value for the entity in code, everything works.

    If I update the model, there is no default value set on the entity, is that by design and do I still need to set a default value?

    Monday, November 18, 2013 2:13 PM

Answers

  • Hello,

    >>There is a DateTime column with a default value.

    Where is the default value that you have defined? In the table or in the entity mode in designer?

    >>If I update the model,

    How have you update the model? Delete the default value in table?

    >> there is no default value set on the entity, is that by design and do I still need to set a default value?

    If you have default value in table, it will not set it on the entity model, it is by design. We have to set a default value. If you do not want to set it on the program, we can set it on the datetime type filed property:

    If I have misunderstood, please let me know.

    Regards.


    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 Fred Bao Tuesday, November 26, 2013 7:49 AM
    Tuesday, November 19, 2013 7:37 AM