Solve For a SqlCE Error When Select:ExceptionCode: 0xc0000005;NativeMethods.GetKeyInfo
Posted on 2010-01-16 17:59 大米猫咪来回变 阅读(2252) 评论(0) 收藏 举报SQLCE读取数据时出现如下错误:
The Error Is:
SQLCE3.5 Error
This Error is because of the different version of SqlCe Between WinCeOs and the develop Tools(Vs2005 or Vs2008). The Version of SqlCe of Wince Os can check the “sqlcecompact35.dll” file in OS PB Develop Folder(Such as xxx\xxx\reldir\xxx_release\). The Version of SqlCe of Develop Tools can check the References of your project.If the Version is Differnce , we can remove the References of your project, and inclues it from the wince folder. (such as xxx\wince600\other\sqlcompact\managed\system.data.sqlserverce.dll)
出现这个错误可能是因为PB(即WINCE内核)使用的SQLCE和应用程序开发使用的SQLCE的版本不同;造成这种现象一个常见的原因是打了SQLCE的补丁(SP1或者SP2beta)。此时,PB(WINCE OS)中使用的是Patch后的SQLCE,而在开发工具VS中使用的是原3.5版本的SQLCE。要检查OS中使用的SQLCE可以在PB的目录下(输出OS文件Nk.bin所在的目录)查找sqlcecompact35.dll,右键查看文件属性并检查它的版本(如果是SP2beta 2,其版本为3.4.5692.0)。要检查开发工具VS中的版本,可以查看项目下Referrence下的System.data.SqlServerCe的版本,一般情况下为3.5.0.0。如果发现两个版本不一致,则可将原引用去除,然后重新添加引用。dll的位置在wince的安装目录下,如果是缺省安装目录,则文件位置为c:\wince600\other\sqlcompact\managed\system.data.sqlserverce.dl。(该引用的版本为3.5.1.0)。
浙公网安备 33010602011771号