Hi,
I am using this simple code to try and update a row
var MyDB = new SKN2DataContext();
var s_case = MyDB.SupportCases.FirstOrDefault(sc => sc.Id == 3);
s_case.OpenDate = DateTime.Now;
MyDB.SubmitChanges();
On the last line i am presented with the following exception
Value of member 'Id' of an object of type 'SupportCase' changed. A member defining the identity of the object cannot be changed. Consider adding a new object with new identity and deleting the existing one instead.
When I see what's going on by calling GetChangeList in QuickWatch, it says that the DataContext is trying to do and update (which i expect) as well as an insert of the same row (WHY???). I can't figure out why the DataContext is trying to do an insert. Please help!!!
EDIT Just for the record OpenDate is not included in the primary key