The “X” property on “Y” could not be set to a 'null' value. You must set this property to a non-null value of type 'Int32'

前端 未结 11 1419
花落未央
花落未央 2020-12-29 21:38

When I run my application and I click a specific button I get the error:

\"The \"X\" property on \"Y\" could not be set to a \'null\' value. You must set thi         


        
11条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-29 22:00

    For me the following Steps corrected the Error:

    1. Remove the 'X'-Property from the 'Y'-Table
    2. Save EDMX
    3. build Database from Model
    4. compile
    5. Add the 'X'-Property to 'Y'-Table again (with non-nullable and int16)
    6. Save EDMX
    7. build Database from Model
    8. compile

提交回复
热议问题