The most likely problem is that
ID is most likely the
Identity column for the table.
If you look at the actual SQL statement itself
Update Reports
set ID = @id
, Comments = @comments
, marks = @marks
, Reviewer = @rvr
, ReviewerDate = @rvrd
Where (ID = @id)
You may scratch your head when you think about the logic-- change the ID on the selected row when the ID matches the one provided; Why would you need to change the value to what it already is becomes the question.
The answer is you don't need to; and by not attempting to change it you will not get the exception message you received.
So all you need to do is remove that portion of the SQL Command...
Update Reports
set Comments = @comments
, marks = @marks
, Reviewer = @rvr
, ReviewerDate = @rvrd
Where (ID = @id)
... and then you should be good to go.
Presuming that
ID is the identity column naturally