locked
using Sync Service on Windows Mobile 5.0 apps RRS feed

  • Question

  • Hi I am developing an application on windows mobile 5.0 environment and using VS 2005 for the same.

     

    I thought of making use Microsoft ADO.Net synchronization services for sync funcionality.

     

    I am trying to make use of the same code as available in OfflineAppDemo-TSQL+SProc but trying to convert it to Windows Mobile 5.0 project.

     

    But soem code are so specific to desktop environment that it wouldn't work on Win Mobile:

     

    DbServerSyncProvider serverSyncProvider = new DbServerSyncProvider();

    SyncAgent syncAgent = new SyncAgent();

    syncAgent.ServerSyncProvider = serverSyncProvider;

    //System.Data.SqlClient.SqlConnection

    //SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();

    ////Data Source=SRINSOFT;Initial Catalog=GreyhoundDB;User ID=sa

    ////

    //// 2. Prepare server db connection and attach it to the sync agent

    ////

    //builder["Data Source"] = @"RAJESH\SQLEXPRESS";

    //builder["integrated Security"] = true;

    //builder["Initial Catalog"] = "ClientInfo";

    //builder["User ID"] = "sa";

    //builder["Password"] = "";

    SqlConnection serverConnection = new SqlConnection(" Data Source=srinsoft\\SQLEXPRESS;Initial Catalog=ClientInfo;Integrated Security=True");

    //System.Data.SqlServerCe.SqlCeConnection serverConnection = newI SqlCeConnection("");

    serverSyncProvider.Connection = serverConnection;

     

    Like in the above sample, the SQLConnectionBuilder wont work.

    The last line which I have highlighted in bold gives an erroe:

    Cannot implicitly convert type 'System.Data.SqlClient.SqlConnection' to 'System.Data.IDbConnection' D:\TestProjects\WinMobile5.0Projects\SamplePrj1\TestSampleApp\TestSampleApp\ClientList.cs 106 49 TestSampleApp

     

    Is it not possible to use the DBSyncProvider and the SyncAgent classes on WindowsMobile project.

    I do get similar errors with the command object when trying to execute queries

     

    Error 7 Cannot implicitly convert type 'System.Data.SqlClient.SqlCommand' to 'System.Data.IDbCommand' D:\TestProjects\WinMobile5.0Projects\SamplePrj1\TestSampleApp\TestSampleApp\ClientList.cs 199 72 TestSampleApp

     

    Can you pls help me out with this asap.

     

    • Moved by Max Wang_1983 Friday, April 22, 2011 11:00 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Sunday, April 15, 2007 5:15 PM

Answers

  • Hi,

     

    I don't know that release date for the devices version since it is not final yet. Work in progress though and you should expect to hear more concrete plans soon.

     

    Yes, you are right. The devices support won't have the Server DLL which means you will need to access the server side through webservice or WCF.

     

    The current solutions for sync data to PPC are:

    1- RDA (Remote Data Access)

    2- SQL Server Merge Replication

     

    Thanks

    Tuesday, April 17, 2007 1:12 AM

All replies

  • Hi there,

     

    - The current CTP is not for devices (basically, it does not work against .net compact framework). The plan is to ship devices-ready version at a later stage.

    - The future support for devices won't enable direct connection to server database scenrio still, you will need to use Web Services, WFC, or any custom transport to talk to the server. The Microsoft.Synchronization.Data.Server.dll won't run on devices.

     

    Thanks!

    Monday, April 16, 2007 2:32 AM
  • Hi Rafik.

     

    Thanks a lot for your inputs.

    I was under the impression that ADO.Net sync would be the best bet for me to make use of sync funcionality for windows mobile apps.

    But it would really be good to have it working on devices. So any idea as to when the device ready version would be available.

     

    When you say direct connection wouldn't be available, does it mean that I would have to maintain a webservice/wcf which can do the server sync process like in your webservice demo and then can have the Microsoft.Synchronization.Data.Client.dll running on the device for client level sync.

     

    Pls do clear me if I am wrong.

     

    Rafik, any other way I can achieve sync between a windows mobile 5.0 pocket pc app and a DB server.

    Pls do let me know I am to start this project asap and I am kind of stuck with the syn part of it.

     

     

    Monday, April 16, 2007 2:54 PM
  • Hi,

     

    I don't know that release date for the devices version since it is not final yet. Work in progress though and you should expect to hear more concrete plans soon.

     

    Yes, you are right. The devices support won't have the Server DLL which means you will need to access the server side through webservice or WCF.

     

    The current solutions for sync data to PPC are:

    1- RDA (Remote Data Access)

    2- SQL Server Merge Replication

     

    Thanks

    Tuesday, April 17, 2007 1:12 AM
  • Hi Rafik

     

    Thanks for the same, I hope it should be available atleast by end June/July this year, cause, I really dont want to move on with sql merge replication or RDA, because of the setup process it has to go through, it makes it so much difficult for one to deploy it over a clients location.

     

    Any other idea you can think of by which I can achieve this. even if there is a third party soltuon which I can lookout for it would be ok.

     

     

    Tuesday, April 17, 2007 10:13 PM
  • read this msdn article for implimenting data sync mechanism by yourself.

    http://msdn2.microsoft.com/en-us/library/ms838177.aspx

    Saturday, May 5, 2007 3:06 AM
  • Hi Bob/Rafik

     

    Any idea if the sync service is now available for development on pocket pc / smart phones to sync data from handhelds to sql server.

     

    Please do let me know

    Tuesday, June 19, 2007 10:37 AM