Connectivity Overview

Microsoft SQL Server Compact 3.5 (SQL Server Compact 3.5) supports three methods of exchanging data with a SQL Server database:

Remote data access (RDA) provides a simple way for a smart device application to access (pull) and send (push) data to and from a remote Microsoft SQL Server database table and a local SQL Server Compact 3.5 database table. You can also use RDA to issue SQL commands on a computer that is running SQL Server.

Merge replication lets sites make autonomous changes to replicated data, and merge changes and resolve conflicts when it is required.

Microsoft Synchronization Services for ADO.NET enables synchronization between databases, such as between a SQL Server Compact client database and any server database for which an ADO.NET provider is available.

Connecting SQL Server Compact 3.5 to SQL Server

When you use either RDA or replication, SQL Server Compact 3.5 connects to SQL Server through a computer that is running Microsoft Internet Information Services (IIS). Because connectivity to SQL Server is handled by IIS, your device needs only the ability to connect to the IIS Web server using the HTTP or HTTPS protocol. This lets you perform RDA and replication operations over any type of network connection that supports HTTP: local area networks (LANs), wide area networks (WANs), and Microsoft ActiveSync connections.

You connect SQL Server Compact 3.5 to the IIS server by providing the connection information within your smart device application code, or by using the smart device's Connection Manager.

Connection Manager Integration

The primary purpose of the Connection Manager is to centralize and automate the establishment and management of the network connections on a device. Applications on the device, including your SQL Server Compact 3.5 application, can use the Connection Manager to establish or schedule a network connection. The Connection Manager handles the details of the connection, and the application informs the Connection Manager of the network type to use for the connection. For more information about using Connection Manager integration, see ConnectionManager Property (RDA) and ConnectionManager Property (Replication).

Security and Optimization

SQL Server Compact 3.5 uses the HTTP and HTTPS protocols to connect to SQL Server by using IIS.

Important

SQL Server Compact 3.5 Service Pack 1 and earlier versions do not support the "chunked" transfer-coding feature of HTTP/1.1 RFC 2616. This might cause the synchronization to fail in some cases.

Security Features

By connecting by using IIS, SQL Server Compact 3.5 applications take advantage of the built-in IIS authentication and authorization services. IIS authenticates the smart device, and then either connects to SQL Server under its own user account or the user account provided by the smart device.

Because the device connects to a virtual directory on the Web server, you can configure the virtual directory in IIS to use the Secure Sockets Layer (SSL) protocol. This ensures that all data transferred between the device and IIS is encrypted. Because many devices might connect over a wireless connection, encrypting the data provides additional security.

For more information about configuring security, see Configuring and Securing the Server Environment.

Optimization Features

SQL Server Compact 3.5 has two connectivity optimization features:

  • Compression
    SQL Server Compact 3.5 uses compression to reduce the amount of transmitted data.
  • Connection recovery
    After a communication failure, synchronization will continue from the last successfully transmitted message buffer if the connection is restored within the connection retry timeout.

You can set the compression level and the connection retry timeout to meet your specific application needs.

See Also

Concepts

Configuring and Securing the Server Environment
Microsoft Synchronization Services for ADO.NET

Other Resources

Managing Connectivity (SQL Server Compact)

Help and Information

Getting Assistance (SQL Server Compact 3.5 Service Pack 1)