Click here to Skip to main content
12,951,548 members (52,137 online)
Click here to Skip to main content
Add your own
alternative version


38 bookmarked
Posted 16 Nov 2006

Using SQL Server CE Mobile with SQL Server through RDA

, 16 Nov 2006 CPOL
Rate this:
Please Sign up or sign in to vote.
This article is on communicating with a server through Remote Data Access objects.

Sample Image - DBManager.jpg


In this article, I will talk about Visual Studio .NET mobile developement and the use of RDA Remote Data Access) objects to access data and communicate with a PC. I will show how to synchronize your device with the server and share data. I will focus on RDA and replication. I developed the program for my HP Ipaq HW6500 series Pocket PC. So the screen size may not fit. But you can change it to fit your mobile device's screen size. 

Using the code

Just run the code. It will be installed to your device. The code needs SQL Server CE installed, and sscesa20.dll should be configured. The code uses SQL Server 2000 (2005 has the same manner though) with SP3 and Visual Studio 2003. You can find the required information from here.

An example of the souce code is given below. This is used to pull a table.

SqlCeConnection cn = null;
string rdaOleDbConnectString = 
    "Provider=sqloledb; Data Source=localhost;" + 
    "Initial Catalog=" + DbManager.glbConn.DbName + "; " +
    "User Id=" + DbManager.glbConn.DbUserId + 
    ";Password=" + DbManager.glbConn.DbPassword ;
SqlCeRemoteDataAccess rda = null;
    rda = new SqlCeRemoteDataAccess();
    rda.InternetLogin          = DbManager.glbConn.WebUserId;
    rda.InternetPassword       = DbManager.glbConn.WebPassword;
    rda.InternetUrl            = http://+DbManager.glbConn.ServerIp+
    rda.LocalConnectionString ="Data Source=\\Program Files\\"+
                               this.txtLocalDb.Text + ".sdf";
    if (this.chkDropTable.Checked)
        cn = new SqlCeConnection(rda.LocalConnectionString);
        SqlCeCommand cmd = cn.CreateCommand();
        cmd.CommandText = "DROP TABLE " + this.txtLocalTable.Text;
        if (cn.State != ConnectionState.Closed)
    if (this.cmbTrackOption.Text=="TrackingOff")
    if (this.cmbTrackOption.Text=="TrackingOn")
    if (this.cmbTrackOption.Text=="TrackingOffWithIndexes")
          "ErrorTable"); ...

Key Points

Unless you enter the names and types of the server parameters correctly, you won't be able to use the DA objects, so please be careful about it.

Please notice that rather than using a DataSet for the DataGrid, one must use DataReaders to make efficient use of memmory.

Also, you have to ensure that sscesa20.dll is configured and working correctly. Make sure the path is right.


As I develop more, I will come up with other Mobile examples.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Tolga Birdal
CEO Gravi Information Technologies and Consultancy Ltd
Turkey Turkey
Currently, also an MSc. student in Technical University of Munich, I develop practical application in computer vision for more than 5 years. I design real-time solutions to industrial and practical vision problems, both 3D and 2D. Very interested in developing algorithms in C relating math and vision.

Please visit Gravi's web page ( and my page ( to learn more about what we develop.

I admire performance in algorithms.

"Great minds never die, they just tend to infinity..."

You may also be interested in...


Comments and Discussions

Generala bug! Pin
885313138-Oct-08 0:47
member885313138-Oct-08 0:47 
Generalmissing method exception Pin
mokhabarat3-May-07 12:20
membermokhabarat3-May-07 12:20 
GeneralRe: missing method exception Pin
Tolga Birdal3-May-07 23:47
memberTolga Birdal3-May-07 23:47 
Generalcontact Pin
theboescho14-Dec-06 7:52
membertheboescho14-Dec-06 7:52 
QuestionComms over GPRS Pin
djgann19-Nov-06 20:27
memberdjgann19-Nov-06 20:27 
AnswerRe: Comms over GPRS Pin
Tolga Birdal21-Nov-06 13:48
memberTolga Birdal21-Nov-06 13:48 
GeneralRe: Comms over GPRS Pin
Tolga Birdal21-Nov-06 13:48
memberTolga Birdal21-Nov-06 13:48 
GeneralRe: Comms over GPRS Pin
Tolga Birdal22-Nov-06 11:32
memberTolga Birdal22-Nov-06 11:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170525.1 | Last Updated 16 Nov 2006
Article Copyright 2006 by Tolga Birdal
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid