How to: Build and Deploy an Application to a Desktop and Tablet PC

Building and deploying an application that is based on Microsoft SQL Server 2005 Compact Edition (SQL Server Compact Edition) to a desktop or a tablet PC resembles deploying any other Microsoft Windows application. To do this, you develop a Windows application that references the appropriate SQL Server Compact Edition .dll files.

To build and deploy a SQL Server Compact Edition Windows application

  1. Install SQL Server Compact Edition by running the installer (SQLServerEv31-EN.msi).

  2. In your Microsoft Visual Studio 2005 project, add a reference to System.Data.SqlServerCe.dll file that is in the folder - %Program Files%\Microsoft SQL Server Compact Edition\v3.1. For more information, see Building Application for Desktop and Tablet PCs (SQL Server Compact Edition).

  3. Build and deploy the application to the target desktop or tablet pc. On the target desktop or tablet PC, install the SQL Server Compact Edition by running the installer (SQLServerEv31-EN.msi). An alternative method of deployment is ClickOnce.

    1. ClickOnce is a new software installation technology in Visual Studio 2005 that is supported by SQL Server Compact Edition for deploying managed applications on Desktop and Tablet PC. ClickOnce simplifies deploying a Windows-based application to a Web server or network file share. For administrators, deploying or updating an application consists of updating files on a server. Each client does not have to be updated separately. Visual Studio 2005 provides full support for publishing and updating applications that are deployed with ClickOnce. ClickOnce deployment is available for projects that are created by using Visual Basic, Visual C#, and Visual J#, but not for Visual C++. For more information about ClickOnce, see the ClickOnce page on MSDN.
  4. To integrate ClickOnce with SQL Server Compact Edition, download the SqlEv31ClickOnce_EN.zip file from the SQL Server.

    Note

    If you are using the original release version of Visual Studio 2005, you must perform steps 5 and 6 to integrate ClickOnce with SQL Server Compact Edition. Visual Studio 2005 SP1 version automatically integrates ClickOnce with SQL Server Compact Edition.

  5. SqlEv31ClickOnce_EN.zip file contains the following:

    1. Product.xml -- Defines the base package.
    2. Package.xml -- Defines any localization-specific information or functionality.
    3. sqlev31eula-EN.txt -- Contains the Microsoft Software License Terms.
      Put these files in the /SQL Server Compact Edition directory, as shown:
      %Program Files%\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\SQL Server Compact Edition\Product.xml
      %Program Files%\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\SQL Server Compact Edition\en\Package.xml
      %Program Files%\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\SQL Server Compact Edition\en\sqlev31eula-EN.txt
  6. To keep the local copy of the SQL Server Compact Edition installation file (SQLServerEv31-EN.msi), copy it to the %Program Files%\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\SQL Server Compact Edition\en folder.