Windows Phone 7 SQL Server CE rowversion

倾然丶 夕夏残阳落幕 提交于 2019-12-04 06:43:37

问题


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)]

回答1:


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.



来源:https://stackoverflow.com/questions/8622896/windows-phone-7-sql-server-ce-rowversion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!