选择正确的SQLServerCompact安装包
来源:优易学  2011-2-9 12:37:39   【优易学:中国教育考试门户网】   资料下载   IT书店
  如果你是使用Visual Studio 2005/2008开发.NET Compact Framework应用程序,并在程序中用到了SQL Server Compact数据库,Visual Studio在向设备(或仿真器)部署你的程序时,会自动将SQL Server Compact一同部署上去。如果你开发的是Native Code的应用程序,就需要自己手动部署SQL Server Compact安装包了。另外,在给最终用户的设备部署应用程序时,也是需要自己手动部署SQL Server Compact的。
  SQL Server Compact的安装包存放在以下位置,我们暂称为安装包“根目录”:  
版本号 路径
3.0/3.1 %Program Files%Microsoft Visual Studio 8SmartDevicesSDKSQL ServerMobilev3.0
3.5 %Program Files%Microsoft SQL Server Compact Editionv3.5Devices
  根目录下有wce400和wce500两个子目录,分别存放着以Windows CE 4.0和Windows CE 5.0为内核的操作系统平台的安装包。Windows Mobile 2003和Windows CE 4.0版本的SQL Server Compact安装包在wce400目录下;Windows Mobile 5.0/6.0/6.1和Windows CE 5.0/6.0的SQL Server Compact安装包在wce500目录下。
目录 平台
wce400 Windows Mobile 2003, Windows CE 4.0
wce500 Windows Mobile 5.0/6.0/6.1, Windows CE 5.0/6.0
  打开wce500目录,可以看到一些以处理器名称命名的子目录,目录名分别为armv4i, mipsii, mipsii_fp, mipsiv, mipsiv_fp, sh4和x86。Windows Mobile设备的CPU一般都属于armv4i,Windows CE则要看具体的硬件。
  打开armv4i目录,可以看到一些.cab文件。下面表格就以SQL Server Compact 3.1为基础描述了每个安装包文件的功能和适用平台:
安装包 平台 功能
sqlce30.wce5.armv4i.CAB Windows CE Engine
sqlce30.ppc.wce5.armv4i.CAB Windows Mobile Pocket PC Engine
sqlce30.phone.wce5.armv4i.CAB Windows Mobile Smartphone Engine
sqlce30.repl.wce5.armv4i.CAB Windows CE Merge Replication
sqlce30.repl.ppc.wce5.armv4i.CAB Windows Mobile Pocket PC Merge Replication
sqlce30.repl.phone.wce5.armv4i.CAB Windows Mobile Smartphone Merge Replication
sqlce30.dev.ENU.wce5.armv4i.CAB Windows CE Query Analyzer
sqlce30.dev.ENU.ppc.wce5.armv4i.CAB Windows Mobile Pocket PC Query Analyzer
sqlce30.dev.ENU.phone.wce5.armv4i.CAB Windows Mobile Smartphone Query Analyzer
  从上表可以看出,SQL Server Compact的安装包分为Engine, Merge Replication和Query Analyzer三部分功能,每部分功能又分Windows CE, Windows Mobile PocketPC和Windows Mobile Smartphone三种操作系统平台。因此armv4i目录下面会有9个.cab安装包。在很多情况下,只需要安装Engine就够了;如果你需要让SQL Server Compact支持RDA或Merge Replication数据同步功能,就要再安装Merge Replication组件;如果你想要在设备上直接使用查询分析器创建、打开、查询SQL Server Compact数据库,或者在设备上调试程序,那就要再安装Query Analyzer组件。也就是说,Engine组件是必选的,Merge Replication和Query Analyzer组件是可选的。
  每个组件安装包里面包含了不同的文件,在下表中列出:
安装包 包含文件
sqlce.platform.processor.cab sqlcese30.dll sqlceqp30.dll sqlceme30.dll System.Data.SqlServerCe.dll
sqlce30.repl.platform.processor.cab sqlceca30.dll sqlceoledb30.dll sqlcecompact30.dll
sqlce30.dev.lang.platform.processor.cab isqlw30.exe sqlceerr30lang.dll
  如果你的设备安装了SQL Server Compact后,不能正常运行,尝试检查一下是否安装了错误的版本?

责任编辑:小草

文章搜索:
 相关文章
热点资讯
热门课程培训