An occasionally connected application is an application that uses data from a remote database but that might not always have access to the remote database. Occasionally connected applications are also used when access is continuously available but it might not be efficient to continuously query the remote database for data that is rarely changed, such as a list of states or product categories. In these situations, applications can use data from a local database that is located on the client and periodically synchronize the data with the remote database on the server.
In other words, if your application requires data from a remote database that does not have to be continuously retrieved from the database, you can use a local database cache to store the data on the client computer or directly inside your application. For example, consider an inventory application that uses data from several tables in a database. The number of items in stock for any individual part is an important piece of data that continually changes, so the application should always reflect the current values in the database if possible. However, your application also displays a list of valid shipping companies that rarely changes. These valid shipping companies are stored in the shippers table and do not have to be retrieved every time data is queried from the database. By storing this shippers table in a local database cache, you can decrease the number of unnecessary roundtrips that your application has to make to the remote database. So, in addition to using a local database cache for applications that have occasional connectivity, consider storing data that changes infrequently, or that changes on a known schedule, in a local database cache.
You can configure caching to store individual tables, sets of tables, or specific records queried from a table (for example, only customers who have a specific sales representative).
The synchronization of data between client and server databases is facilitated by Microsoft Synchronization Services for ADO.NET (the Microsoft.Synchronization.Data namespace). You can configure synchronization visually in Visual Studio by using the Configure Data Synchronization dialog box.
Starting in Visual Studio 2008 SP1, in addition to the Configure Data Synchronization dialog box, you can also use the Data Source Configuration Wizard to configure synchronization. During configuration of a typed dataset, select the option to Enable local database caching on the Choose Your Database Objects page of the wizard. For more information, see Walkthrough: Creating an Occasionally Connected Application by Using the Data Source Configuration Wizard.
In addition, support for the change tracking feature in SQL Server 2008 has been added for Visual Studio 2008 SP1. You can enable SQL Server 2008 change tracking when you configure synchronization from the Configure Data Synchronization dialog box or the Data Source Configuration Wizard. For more information, see How to: Configure Data Synchronization to Use SQL Server Change Tracking.