1

我开始在Windows Mobile 6.5上编程。 我安装了VS2008,SDK 6.0和DTK 6.5.3。创建项目(WM 6.0,.NET 3.5),并且不使用System.Data.SqlClient。我只有System.Data是Common,SqlTypes。 参考文献被创作者包含在内。SmartDevice项目中缺少Data.SqlClient命名空间(Windows Mobile)

SqlCommand comm = new SqlCommand(sSQL,new SqlConnection(sConn)); 无法解析符号'SqlCommand'

我错过了什么吗?如何从设备连接Sql Server?互联网上的许多例子包括这种方法。

我还安装了.NET 4.0,4.5和VS 2012

No SqlClient reference No resolve option .NEt 3.5 desktop WinForm

回答

2

虽然我不知道TDK是什么,你需要下载并安装SQL Server CE /紧凑分开拿到SQLClientCE等对象:

Windows Desktop

Windows Mobile

FOR WINDOWS MOBILE USE INSTALL THE LINOND DOWNLOAD DOWNLOAD!

请注意,Windos Mobile 6.5应用程序无法使用.NET 4或VS 2012或VS 2010开发.Windows Mobile/Embeddded Handheld Programming仅支持到VS 2008!

在安装Sql Server Compact for Mobile之后,您将有一个新程序目录“C:\ Program Files(x86)\ Microsoft SQL Server Compact Edition \ v3.5”(另请参阅附件slq_server_compact35_files.txt)。现在

Folder PATH listing 
Volume serial number is 00000200 7803:48E6 
C:. 
| EULA_EN.rtf 
| EULA_ENU.rtf 
| ReadmeSSCE35_ENU.htm 
| REDIST_ENU.TXT 
| sqlceca35.dll 
| sqlcecompact35.dll 
| sqlceer35EN.dll 
| sqlceme35.dll 
| sqlceoledb35.dll 
| sqlceqp35.dll 
| sqlcese35.dll 
| System.Data.SqlServerCe.Entity.dll 
| 
+---Desktop 
| | System.Data.SqlServerCe.dll 
| | 
| \---EN 
|   System.Data.SqlServerCe.xml 
|   
+---Devices 
| | EULA_ENU.rtf 
| | System.Data.SqlServerCe.dll 
| | 
| +---Client 
| | | System.Data.SqlClient.dll 
| | | 
| | +---EN 
| | |  System.Data.SqlClient.xml 
| | |  
| | +---wce400 
| | | \---armv4 
| | |   dbnetlib.dll 
| | |   sql.dev.ENU.ppc.wce4.armv4.CAB 
| | |   sql.ppc.wce4.armv4.CAB 
| | |   
| | \---wce500 
| |  +---armv4i 
| |  |  dbnetlib.dll 
| |  |  sql.dev.ENU.phone.wce5.armv4i.CAB 
| |  |  sql.dev.ENU.ppc.wce5.armv4i.CAB 
| |  |  sql.dev.ENU.wce5.armv4i.CAB 
| |  |  sql.phone.wce5.armv4i.CAB 
| |  |  sql.ppc.wce5.armv4i.CAB 
| |  |  sql.wce5.armv4i.CAB 
| |  |  
| |  +---mipsii 
| |  |  dbnetlib.dll 
| |  |  sql.dev.ENU.wce5.mipsii.CAB 
| |  |  sql.wce5.mipsii.CAB 
| |  |  
| |  +---mipsii_fp 
| |  |  dbnetlib.dll 
| |  |  sql.dev.ENU.wce5.mipsii_fp.CAB 
| |  |  sql.wce5.mipsii_fp.CAB 
| |  |  
| |  +---mipsiv 
| |  |  dbnetlib.dll 
| |  |  sql.dev.ENU.wce5.mipsiv.CAB 
| |  |  sql.wce5.mipsiv.CAB 
| |  |  
| |  +---mipsiv_fp 
| |  |  dbnetlib.dll 
| |  |  sql.dev.ENU.wce5.mipsiv_fp.CAB 
| |  |  sql.wce5.mipsiv_fp.CAB 
| |  |  
| |  +---sh4 
| |  |  dbnetlib.dll 
| |  |  sql.dev.ENU.wce5.sh4.CAB 
| |  |  sql.wce5.sh4.CAB 
| |  |  
| |  \---x86 
| |    dbnetlib.dll 
| |    sql.dev.ENU.wce5.x86.CAB 
| |    sql.wce5.x86.CAB 
| |    
| +---EN 
| |  System.Data.SqlServerCe.xml 
| |  
| +---wce400 
| | \---armv4 
| |   sqlce.dev.ENU.ppc.wce4.armv4.CAB 
| |   sqlce.ppc.wce4.armv4.CAB 
| |   sqlce.repl.ppc.wce4.armv4.CAB 
| |   sqlceca35.dll 
| |   sqlcecompact35.dll 
| |   sqlceer35EN.dll 
| |   sqlceme35.dll 
| |   sqlceoledb35.dll 
| |   sqlceqp35.dll 
| |   sqlcese35.dll 
| |   upgrade.exe 
| |   
| \---wce500 
|  +---armv4i 
|  |  sqlce.dev.ENU.phone.wce5.armv4i.CAB 
|  |  sqlce.dev.ENU.ppc.wce5.armv4i.CAB 
|  |  sqlce.dev.ENU.wce5.armv4i.CAB 
|  |  sqlce.phone.wce5.armv4i.CAB 
|  |  sqlce.ppc.wce5.armv4i.CAB 
|  |  sqlce.repl.phone.wce5.armv4i.CAB 
|  |  sqlce.repl.ppc.wce5.armv4i.CAB 
|  |  sqlce.repl.wce5.armv4i.CAB 
|  |  sqlce.wce5.armv4i.CAB 
|  |  sqlceca35.dll 
|  |  sqlcecompact35.dll 
|  |  sqlceer35EN.dll 
|  |  sqlceme35.dll 
|  |  sqlceoledb35.dll 
|  |  sqlceqp35.dll 
|  |  sqlcese35.dll 
|  |  upgrade.exe 
|  |  
|  +---mipsii 
|  |  sqlce.dev.ENU.wce5.mipsii.CAB 
|  |  sqlce.repl.wce5.mipsii.CAB 
|  |  sqlce.wce5.mipsii.CAB 
|  |  sqlceca35.dll 
|  |  sqlcecompact35.dll 
|  |  sqlceer35EN.dll 
|  |  sqlceme35.dll 
|  |  sqlceoledb35.dll 
|  |  sqlceqp35.dll 
|  |  sqlcese35.dll 
|  |  upgrade.exe 
|  |  
|  +---mipsii_fp 
|  |  sqlce.dev.ENU.wce5.mipsii_fp.CAB 
|  |  sqlce.repl.wce5.mipsii_fp.CAB 
|  |  sqlce.wce5.mipsii_fp.CAB 
|  |  sqlceca35.dll 
|  |  sqlcecompact35.dll 
|  |  sqlceer35EN.dll 
|  |  sqlceme35.dll 
|  |  sqlceoledb35.dll 
|  |  sqlceqp35.dll 
|  |  sqlcese35.dll 
|  |  upgrade.exe 
|  |  
|  +---mipsiv 
|  |  sqlce.dev.ENU.wce5.mipsiv.CAB 
|  |  sqlce.repl.wce5.mipsiv.CAB 
|  |  sqlce.wce5.mipsiv.CAB 
|  |  sqlceca35.dll 
|  |  sqlcecompact35.dll 
|  |  sqlceer35EN.dll 
|  |  sqlceme35.dll 
|  |  sqlceoledb35.dll 
|  |  sqlceqp35.dll 
|  |  sqlcese35.dll 
|  |  upgrade.exe 
|  |  
|  +---mipsiv_fp 
|  |  sqlce.dev.ENU.wce5.mipsiv_fp.CAB 
|  |  sqlce.repl.wce5.mipsiv_fp.CAB 
|  |  sqlce.wce5.mipsiv_fp.CAB 
|  |  sqlceca35.dll 
|  |  sqlcecompact35.dll 
|  |  sqlceer35EN.dll 
|  |  sqlceme35.dll 
|  |  sqlceoledb35.dll 
|  |  sqlceqp35.dll 
|  |  sqlcese35.dll 
|  |  upgrade.exe 
|  |  
|  +---sh4 
|  |  sqlce.dev.ENU.wce5.sh4.CAB 
|  |  sqlce.repl.wce5.sh4.CAB 
|  |  sqlce.wce5.sh4.CAB 
|  |  sqlceca35.dll 
|  |  sqlcecompact35.dll 
|  |  sqlceer35EN.dll 
|  |  sqlceme35.dll 
|  |  sqlceoledb35.dll 
|  |  sqlceqp35.dll 
|  |  sqlcese35.dll 
|  |  upgrade.exe 
|  |  
|  \---x86 
|    sqlce.dev.ENU.wce5.x86.CAB 
|    sqlce.repl.wce5.x86.CAB 
|    sqlce.wce5.x86.CAB 
|    sqlceca35.dll 
|    sqlcecompact35.dll 
|    sqlceer35EN.dll 
|    sqlceme35.dll 
|    sqlceoledb35.dll 
|    sqlceqp35.dll 
|    sqlcese35.dll 
|    upgrade.exe 
|    
+---Include 
|  sqlce_err.h 
|  sqlce_oledb.h 
|  sqlce_sync.h 
|  
+---Private 
|  System.Data.SqlServerCe.dll 
|  System.Data.SqlServerCe.Entity.dll 
|  
+---Samples 
|  Northwind.sdf 
|  
\---Tools 
    | ConnWiz.exe 
    | EULA_ENU.rtf 
    | Microsoft.SqlServerCe.Client.dll 
    | Microsoft.SqlServerCe.Enumerator.dll 
    | Microsoft.SqlServerCe.ManagementUI.dll 
    | Microsoft.SqlServerCe.ReplWiz.dll 
    | SSCEServerTools-ENU.msi 
    | 
    \---SQLWorkbenchProjectItems 
     | SQLWorkbenchProjectItems.vsdir 
     | 
     \---SqlCe 
      | sqlce.vsdir 
      | SQLCEFile.sqlce 
      | 
      +---Database 
      |  Create Database.sqlce 
      |  Drop Database.sqlce 
      |  
      +---Index 
      |  Create Index.sqlce 
      |  Create Unique Index.sqlce 
      |  Drop Index.sqlce 
      |  
      \---Table 
        Alter Table Add Column.sqlce 
        Alter Table Add Primary Key.sqlce 
        Alter Table Drop Column.sqlce 
        Alter Table Drop Constraint.sqlce 
        Create Table Primary Key.sqlce 
        Create Table with Identity Column.sqlce 
        Create Table.sqlce 
        Drop Table.sqlce 

,你开始了一个新SmartDevice项目或打开一个现有的后,您必须添加引用要么System.Data.SqlClient的或System.Data.SqlServerCE:

Add SQL assembly to SmartDevice project

+0

我已收到 en_visual_studio_2008_professional_x86_x64wow_dvd_X14-26326.iso Windows Mobile 6 Professional SDK Refresh.exe Windows Mobile 6.5.3 Professional DTK.exe 当我安装SQLClientCE时,我只有修复选项。我很担心将一台计算机与2008和2010混合在一起。.NET 3.5上的示例项目具有Data.SqlClient命名空间。我那个项目包含了lib System.Data.dll。 –

+0

对不起,但我的帖子中的链接是SQL Server 3.5的桌面,而不是移动。这里是正确的链接http://www.microsoft.com/en-us/download/details.aspx?id=8831。您何时为Windows Mobile安装SQL Server Compact 3.5? – josef

+0

我现在安装了它。没有什么改变。 http://imageshack.us/g/13/screenshot2013012716575.png/只有在移动不是SqlClient,大屏幕是从桌面.NET 3.5 WinForm应用程序。 –

相关问题