I had a problem when updating a table in SQL Server CE on Windows Phone 7. When I would call submit changes the app would close without any exceptions or errors. Visual Studio even remained running.
Removing the rowversion
column fixed the problem. I've looked around and not sure if I'm missing something but is there anything special one needs to do when using a rowversion
column?
Here are the attributes for the column. I created a simple table when trying to figure this out. It has 3 columns:
Id
(Guid)TestColumn
(nvarchar100)MyRowVersion
(rowversion)Code:
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MyRowVersion", AutoSync=AutoSync.Always, DbType="rowversion", CanBeNull=true, IsDbGenerated=true, IsVersion=true, UpdateCheck=UpdateCheck.Never)]
Assuming you generate the datacontext with the SQL Server Compact Toolbox, there is a bug, if you have indexes that cover same columns as primary keys, that causes the crash. Try to re-gen the DataContext with the latest Toolbox addin (version 2.6.2 or later). Workaround for the issue is to delete the "duplicate" index.