Skip to main content

Past Blast

Featured Products

Windows Mobile Developer Controls
Windows Mobile Developer Controls
Stay in touch using the DEVBUSS RSS feeds.
 

News

Windows Mobile Developer Controls
Windows Mobile Developer Controls

Configuring Remote Data Access

Written by Rick Winscot  [author's bio]  [read 81976 times]
Edited by Derek

Download the code

Page 1  Page 2 

Click here for a Flash overview of RDA Push and Pull

If you haven't had any experience yet with SQL Server CE, I am sure you will be hooked before you complete your first application. It is an incredible solution for mobile database needs, which offers real performance and scalability.

So...

If YouAreAdvancedUser=True Then
  Skip Introduction
Else
  Read Introduction

Introduction

SQL Server CE provides two methods for SQL Server (desktop) data access.

The first is Replication.

"Merge replication in SQL Server CE is based on Microsoft SQL Server 2000 merge replication and is ideally suited to portable devices because it enables data to be updated independently on the portable device and the server. The data on the device and the server can later be synchronized when the device is connected to the server."
-Microsoft Books Online

One would use replication when the solution requires that any data modification must be maintained on both the handheld and desktop - such as an inventory tracking system.

The second method, is Remote Data Access (RDA).

"Remote data access (RDA) provides a simple way for a Windows CE application to access SQL Server data located in a remote SQL Server 6.5, SQL Server 7.0, or SQL Server 2000 database. RDA can be used whether the Windows CE device is continuously connected or intermittently connected to the SQL Server system. Applications use RDA when they do not need the full functionally of merge replication. You can use RDA without configuring SQL Server replication or creating publications."
-Microsoft Books Online

That is not to say that RDA is a 'poor relative' of Merge Replication. RDA is a great tool to use when only portions of a database need to be transferred to the handheld, and/or a constant sync state is not a priority.

As an example: School administrators want to be able to carry student demographic and emergency contact information around with them - on their handhelds. The data needs to be current, but they wouldn't be making any changes to the records. In this case, Merge Replication wouldn't be necessary - and a simple RDA 'pull' gets the job done. If RDA is all you need, this article is for you.

How it is Done

Remote Data Access on CE handhelds is implemented by a few dll's, a relay agent, IIS and SQL Server. Each piece has its own job, and putting them together can present an issue if you aren't familiar with how they work together. Take a look at this flash animation to see how all the pieces work together.

This Project

You should be able to get this project put together in about an hour following these ten steps. Remember that configuration is everything! If any of your settings are incorrect your project won't work - and it will be difficult to pinpoint the problem. Error messages (if you manage to get one) are usually very vague and may only be the symptom of an earlier error. I have included a list of my top five blunders for your benefit.

I would like to thank TechSmith, makers of Camtasia for making this article possible. I used Camtasia to record movie clips that detail each configuration step - which I hope will guide you through the development process, and help you avoid common mistakes. I highly recommend it for anyone that needs to put instructional presentations together. It's easy to use, and very inexpensive.

All you need is TechSmith's Video Codec for Windows Media Player.

This project was constructed with eVB 3.0, Windows 2000, SQL Server 2000, SQL Server CE, SQL Server CE Relay, Active Sync 3.1, IIS and uses an Anonymous authentication method. Please make sure you have all these items before you start.

Next Page