Walkthrough: Deploying an Occasionally Connected Client Application with the Local Database

Deploying an occasionally connected application together with the local SQL Server Compact 3.5 database is not any more difficult than deploying any SQL Server Compact 3.5 database together with an application.

NoteNote

ClickOnce is the preferred method of deployment for applications that include SQL Server Compact 3.5 databases (as opposed to creating a custom action in a Setup and Deployment project).

This walkthrough provides step-by-step instructions for deploying the application and local database cache that were created in the Walkthrough: Creating an N-Tier Data Application1 topic.

During this walkthrough, you will learn how to perform the following tasks:

  • Configure an application for ClickOnce deployment.

  • Publish the install package.

  • Create an install package.

  • Test the deployment.

To complete this walkthrough, you need to have completed the solution and project created in Walkthrough: Creating an Occasionally Connected Application2.

Note Note

Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. The Visual Studio edition that you have and the settings that you use determine these elements. For more information, see Visual Studio Settings3.

Because this walkthrough deploys the OCSWalkthrough solution, this solution must first be loaded into Visual Studio.

To open the OCSWalkthrough solution

Because ClickOnce Security and Deployment4 is the preferred method of deployment for applications that include SQL Server Compact 3.5 databases, you will open the Publish Page, Project Designer5 and configure the OCSWalkthrough application for deployment.

To open the publish page and configure ClickOnce deployment

  1. To open the Project Designer, in Solution Explorer, double-click My Project if you are working on a Visual Basic project. (Double-click Properties if you are working on a C# project.)

  2. Click the Publish tab.

  3. Click Application Files and set the .sdf file to Data File (Auto).

    This setting notifies the installer to treat this as a local data file and to put it in the data directory.

  4. Click Prerequisites and select SQL Server Compact 3.5.

    This setting notifies the installer to check whether the SQL Server Compact 3.5 runtime exists and to install it from the Internet if it is not found.

After the publish information is configured, set the location to publish the application's installer to, and then create the installer.

To create the installer

  1. In the Publishing Location box, type the Web site, FTP server, or file path to publish the installer to.

  2. Click Publish Now to create the installer.

To verify deployment

  1. Navigate to the location where you published the installer.

  2. Install the application.

Links Table
1http://msdn.microsoft.com/en-us/library/bb384570.aspx
2http://msdn.microsoft.com/en-us/library/bb384472.aspx
3http://msdn.microsoft.com/en-us/library/2ewd52wf.aspx
4http://msdn.microsoft.com/en-us/library/t71a733d.aspx
5http://msdn.microsoft.com/en-us/library/7azx932h.aspx
6http://msdn.microsoft.com/en-us/library/bb384585.aspx
7http://msdn.microsoft.com/en-us/library/bb629326.aspx
8http://msdn.microsoft.com/en-us/library/aa983341.aspx
9http://msdn.microsoft.com/en-us/library/wzabh8c4.aspx
Community Content Add
Annotations FAQ