This topic describes the two types of application deployment:

  • Deploying your smart device application to one device during development

  • Final application deployment after development is complete

Visual Studio 2008 Service Pack 1 (SP1) is the preferred environment for developing applications for smart devices with SQL Server Compact 3.5 SP2. Visual Studio 2010 does not have support for developing smart device applications. For more information, see Installing a Development Environment.

Deployment During Development

Managed Code Applications

To include Microsoft SQL Server Compact 3.5 in a managed Microsoft Visual Studio project, add a reference to the System.Data.SqlServerCe assembly. When this reference is added, three CAB files are automatically deployed to the smart device every time the application is compiled and deployed:

  • Sqlce.dev.language.platform.processor.cab

  • Sqlce.platform.processor.cab

  • Sqlce.repl.platform.processor.cab

    The DLLs are installed in the \Program Files\Microsoft SQL Server Compact Edition\v3.5 directories. For more information about the contents of each CAB file, see Installing and Deploying on a Device (SQL Server Compact).

Because F5 deployment of smart device applications installs SQL Server Compact 3.5 on the target device, debugging a smart device application always uses the centrally deployed version of SQL Server Compact 3.5. This is true even if the application is built for private deployment of SQL Server Compact 3.5.

Native Code Applications

If you are developing an application in Microsoft Visual C++, SQL Server Compact 3.5 is not automatically installed when you deploy your application. You must first copy the SQL Server Compact 3.5 installation CAB file and install it on the smart device. The CAB file for SQL Server Compact 3.5 is named Sqlce.platform.processor.cab and is located in the following directory:

%Program Files%\Microsoft SQL Server Compact Edition\v3.5\Devices\platform\processor

If your application uses merge replication or RDA, you must also install the Sqlce.repl.platform.processor.cab file.

Final Application Deployment

When your application is complete, and you are ready to deploy it to multiple devices, you create a CAB file for the application, and then use this CAB file to install the application to multiple devices. For more information about packaging device solutions for deployment, including how to create CAB files for device solutions, see the Visual Studio 2008 documentation.

Deploying Applications that use Central Deployment of SQL Server Compact

When you create the CAB file for an application that uses central deployment for SQL Server Compact 3.5, the resulting file should contain only the binaries for your application. It does not include SQL Server Compact 3.5 or the Microsoft .NET Compact Framework. To fully deploy your application, you must copy and extract the SQL Server Compact 3.5 and .NET Compact Framework CAB files together with your application CAB file.

  • The .NET Compact Framework CAB file is named NETCFversion.platform.processor.cab. It is in the following directory:

    \Program Files\Microsoft.NET\SDK\CompactFramework\NETCFversion\WindowsCE\platform\processor\NETCFversion.platform.processor.cab.

  • The CAB files for SQL Server Compact 3.5 are named Sqlce.platform.processor.cab and Sqlce.repl.platform.processor.cab. They are in the following directory:

    %Program Files%\Microsoft SQL Server Compact Edition\v3.5\Devices\platform\processor

For example, to include version 2.0 of the .NET Compact Framework and SQL Server Compact 3.5 in your deployment of an application you have developed for the Windows CE 5 operating system on an armv4 processor, you must include the following two files:

  • C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\WindowsCE\wce500\armv4i \NETCFv2.wce5.armv4.cab

  • C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Devices\wce500\armv4i\sqlce.wce5.armv4i.cab

If your application uses merge replication or RDA, you must also install the Sqlce.repl.platform.processor.cab file.

Deploying Applications that use Private Deployment for SQL Server Compact

When you create the CAB file for an application that uses the private deployment for SQL Server Compact 3.5, the resulting file should contain the binaries for SQL Server Compact 3.5 in addition to the binaries for your application. It does not include the Microsoft .NET Compact Framework. To fully deploy your application, you must copy and extract the .NET Compact Framework CAB file together with your application CAB file. 

To privately deploy SQL Server Compact 3.5 with your application, the CAB file must, at a minimum, contain the following SQL Server Compact 3.5 assemblies and libraries:

  • The .NET Compact Framework Data Provider for SQL Server Compact 3.5 (System.Data.SqlServerCe.dll). This file is in the following directory: %Program Files%\Microsoft SQL Server Compact Edition\v3.5\Devices.

  • The following libraries: sqlceme35.dll, sqlceqp35.dll, and sqlcese35.dll. The native assemblies are in the following directory: %Program Files%\Microsoft SQL Server Compact Edition\v3.5\Devices\platform\processor.

For example, for an application that you have developed for the Windows CE 5 operating system on an armv4 processor, the native libraries are in C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Devices\wce500\armv4i.

Reference

System.Data.SqlClient

Concepts

Private Deployment vs. Central Deployment (SQL Server Compact)

Building Smart Device Applications (SQL Server Compact)