Number of members in conceptual type does not match with number of members on object side type

后端 未结 9 775
梦如初夏
梦如初夏 2020-12-06 09:43

I\'m using .net framework 3.5 SP1.

After adding a column to one table in Sql Server (as well as changing an existing column from allowing nulls to not nullable), I c

9条回答
  •  遥遥无期
    2020-12-06 09:50

    This seems a little verbose for a comment so I'm adding this as another answer:

    In response Craig's suggestion I opened the edmx file in an XML viewer and removed all references to Axis_t (including the associations due to Foreign Keys). From the entire file.

    I then "updated" the model by opening the edmx file as the GUI interface, right-click | refresh from database | Add (tab) which now only lists the Axis_t table. I added the table which seemed to work fine and included my new column and the column was mapped correctly.

    I then ran the project to the same result. Same error as posted above.

    I have now reverted back to what was in source control as well as changing the database columns (new one and modified one) as nullable. The project runs fine. I still have not successfully been able to implement the new DB column in EF. It behaves as if there is some stored/compiled version of the model which is not being updated via the "update" process.

提交回复
热议问题