I am using VS2008, C#, SQL Server Compact Ed 3.5, and SQLCeResultSet.SetValues then SQLCeResultSet.Update to update a record in the database where a GUID is the primary key. When I debug my program everything looks good and all
inserts and updates work perfectly fine except when I try to update this one record in one of the tables I get the following exception:
System.Data.SqlServerCe.SqlCeException was caught
Message="A duplicate value cannot be inserted into a unique index. [ Table name = TableA ,Constraint name = KeyConstraint ]"
Source="SQL Server Compact ADO.NET Data Provider"
at System.Data.SqlServerCe.SqlCeResultSet.InternalUpdate(Object sender)
at MyProgram.UpdateRecords(SqlCeConnection sqlceconnection, SqlCeCommand command, DataTable modified, Properties properties)
The deal is that I am not inserting the record again!! This is an update. I have stepped through the code and it is clearly finding the record in the database, updating the values in the SQLCEResultSet (