Before saving your changes, are you making sure that all not-null properties have a value?

In my case I had to add a hidden value in the view, so the primary key would be posted back to the server.

@Html.HiddenFor(model => model.Id)


For me, the problem was Unique Index on some of the columns in my database. Violating the index was causing this error to be displayed.

But when I was searching for the solution I found there can be other reasons for this error also , like make sure key have values and are not null , check concurrence setting for the column .

Related Articles