vb.netsubsonic2.2

SubSonic Save() changes not working


I am trying to save changes to a record, however I am getting the error

Violation of PRIMARY KEY constraint 'PK_TStoreAssignment'. Cannot insert duplicate key in object 'TAssignment'. The statement has been terminated.

Here is the subsonic query

Dim current = DB.Select().From(TStoreAssignment.Schema) _
                                 .Where("assignmentID").IsEqualTo(selectedRow.AssignmentID) _
                                 .ExecuteSingle(Of TStoreAssignment)()

'Modify the sequence
 current.ManualSequence = 999
 current.Save()

Solution

  • I see two possibilities for this error: