Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error 3031 mapping fragments starting at line 439:Non-nullable column

Error 3031: Problem in mapping fragments starting at line 439:Non-nullable column D_LINK.CARTON_QTY in table D_LINK is mapped to a nullable entity property.

I have a view D_LINK with a column

CARTON_QTY(int, not null)

I dont understand where is my problem do i have to make it null \ how?

like image 395
Sveta26 Avatar asked Dec 29 '11 16:12

Sveta26


4 Answers

refresh the table in your edmx from your database (In model browser, right-click-->Update Model From database --> update tab --> select your table -->click update)

like image 79
DRM Avatar answered Nov 15 '22 07:11

DRM


The error says that your column in the table / view is not nullable but the property of the class in entity model is nullable. They must both be either nullable or not nullable.

like image 37
Ladislav Mrnka Avatar answered Nov 15 '22 07:11

Ladislav Mrnka


Just delete that particular table from the model and add it again. That will solve your problem.

like image 44
Sapumal Jayaratne Avatar answered Nov 15 '22 06:11

Sapumal Jayaratne


I got this issue after changing a none-nullable column to a nullable one. What solved it for me was the following:

  1. Manually edit the column and the link the column had to another table to (0...1) in the .edbx file.
  2. After the manual edit do a update table like DRM described.

One of the actions alone did not solve my problem(feels like a glitch). Hope this can help someone.

like image 43
Magnus Karlsson Avatar answered Nov 15 '22 06:11

Magnus Karlsson