1

I start programing on Windows Mobile 6.5. I install VS2008, SDK 6.0 and DTK 6.5.3. Create project (WM 6.0, .NET 3.5) and the is no using System.Data.SqlClient. I System.Data only is Common, SqlTypes. References are included by creator.

SqlCommand comm = new SqlCommand(sSQL, new SqlConnection(sConn)); Cannot resolve symbol 'SqlCommand'

Did I miss something? How to connect Sql Server from device? Many examples on internet include this methods.

I have also installed .NET 4.0, 4.5 and VS 2012.

No SqlClient reference No resolve option .NEt 3.5 desktop WinForm

Adrian Botor
  • 362
  • 3
  • 17

1 Answers1

2

although I dont know what TDK is, you need to download and install sql server ce/compact separately to get the SQLClientCE etc objects:

Windows Desktop

Windows Mobile

FOR WINDOWS MOBILE USE INSTALL THE SECOND LINK DOWNLOAD!

Be aware that Windos Mobile 6.5 apps can not be developed with .NET 4 or VS 2012 or VS 2010. Windows Mobile / Embeddded Handheld Programming is only supported up to VS 2008!

After the installation of Sql Server Compact for Mobile, you have a new programs dir "C:\Program Files (x86)\Microsoft SQL Server Compact Edition\v3.5" (see also attached 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

Now, after you started a new SmartDevice project or opened an existing one, you have to ADD references to either System.Data.SqlClient or System.Data.SqlServerCE:

Add SQL assembly to SmartDevice project

josef
  • 5,951
  • 1
  • 13
  • 24
  • I have istalled 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 When i would install SQLClientCE i have only repair option. I am worry about mixing i one computer vs 2008 and 2010. Sample project on .NET 3.5 has Data.SqlClient namespace. I that project are included lib System.Data.dll. – Adrian Botor Jan 27 '13 at 07:30
  • Sorry, but the link in my post was to SQL Server 3.5 for Desktop and not for Mobile. Here is the correct link http://www.microsoft.com/en-us/download/details.aspx?id=8831. When did you install SQL Server Compact 3.5 for Windows Mobile? – josef Jan 27 '13 at 15:11
  • I installed it now. Nothing was changed. http://imageshack.us/g/13/screenshot2013012716575.png/ Only in mobile is no SqlClient, Big screen is from desktop .NET 3.5 WinForm app. – Adrian Botor Jan 27 '13 at 16:06
  • 1
    AFAIR the SQLCE .net assemblies are not linked into VS2008 for SmartDevice automatically. So you will not find them, when you just use Add Reference. You have to use the browser inside Add Reference and point it to the assembly dir of your SQLCE installation within the Programs Dir of your PC. – josef Jan 27 '13 at 21:04
  • 1
    See my changes in answer. In your screenshots I cannot see that you added references to the SQLClient or SQLserverCE assembly. To add an reference right clich References in Project Explorer of VS and select Add click "Add Reference...". I thought that was/is clear. By default a SmartDevice Project automatically includes only references to mscorlib, system, system.core, system.data, system.drawing, system.windows.forms, system.xml and system.xml.linq (last two for CF 3.5 projects) – josef Jan 28 '13 at 08:33
  • This is it! :) I forget about add references because i am working on desktop apps where this i included automatically. – Adrian Botor Jan 28 '13 at 09:52