Access to Sql Server Compact database on a mobile device
-
Wednesday, December 12, 2012 9:32 PM
Hi. I have this trouble: i'm using SQL Server compact 3.5 sp2, and i want to develop a desktop application for synchronize a Sql Server database and a Sql Server Compact database on a mobile device (Windows Mobile 6). The string connection for mobile database according with server explorer in VS2008 is "Data Source = Mobile Device\program files\....\mydd.sdf" but i get an error, the path for the mobile database is invalid. I found that if i use Microsoft.SqlserverCe.Client instead of System.Data.SqlServerCe, the application can use the connectionstring with "Data Source= Mobile Device......", but the connection of SqlSyncProvider of my SyncOrchestrator is looking for a connection of type System.data.SqlServerCe.SqlCeConnection and my connection is type Microsoft.SqlServerCe.Client. Could somebody help to solve this issue?. What i have to do, to find the correct path of my device database?. Thanks in advance.
Miguel
All Replies
-
Thursday, December 13, 2012 3:17 AMModerator
are you trying to access the SDF on the mobile device from you the desktop app?
-
Thursday, December 13, 2012 5:37 AMHi June... yes, my SDF file is on the mobile device.
-
Thursday, December 13, 2012 5:49 AMModerator
normally its the other way around, the mobile device initiating a sync to a server or desktop... see: http://msdn.microsoft.com/en-us/library/cc488004(v=vs.90).aspx
-
Thursday, December 13, 2012 6:36 AMThank you June. I have a question: why is considered that the sync direction is from device to desktop?. In some framework sync documentation, it seems that the sync direction is from desktop or server to device, i mean, the server or desktop request access to mobile database, in the article that you suggest, the device request the access to server database. That is why my concern about to know how my desktop application needs to do to get access to the device database.
-
Thursday, December 13, 2012 7:00 AMModerator
where you initiate a sync is independent of the sync direction...
for example, a device can initiate a download or an upload sync...
-
Thursday, December 13, 2012 5:04 PMThank you June for your time and support. Best Regards. Miguel (México)
-
Thursday, December 13, 2012 7:47 PMHi again. I try to recreate the example in the article. I have installed the Microsoft .NET Compact 3.5 Framework SP2, and the example in the article uses Microsoft .NET Compact 3.5 SP1. Well, when i configure the "Configure Data Synchronization" dialog box, i receive the same error about the Path of Mobile Device database, the path is not recognized :(. Do you recommend uninstall SP2 and use SP1?
-
Friday, December 14, 2012 9:29 AMModerator
the example in the article assumes that its your windows mobile app that's connecting to the SQLCE database, can you not just point to the actual path minus the "Mobile Device"?

