locked
Sync work condition for SQLExpressProviderSample RRS feed

  • Question

  • I downloaded a sample SQLExpressProviderSample from http://code.msdn.microsoft.com/sync/Release/ProjectReleases.aspx?ReleaseId=1200.  (SQL Express - Client Synchronization Sample (C# v2.0 CTP1) )

    I tested the sample and have some questions:

    1) I deleted all records in local and remote server, make random insert 3 records, click synchoronize, it works fine, and then

    2) I deleted 1 record from remote, click sync again, but sync did not work. Remote server is only 2 records. How to make sync work to add another record which is exactly from local server?

    3) The same thing happend in local server. After 1), both local and remote have 3 records. I deleted 2 records in local server and then click sync but nothing happend. How to make sync work, that is, after sync, local and remote should be only one record left. Is it possible?

     

     

    Thursday, April 1, 2010 1:45 PM

All replies

  • Hello -

    I would suggest that using SqlSyncProvider (from Microsoft Sync Framework 2.0) to sync databases between SQL server and SQL express server.  Basically SqlSyncProvider should work for both.

    Please refer to the following samples.

    Database Sync - SQL Server and SQL Server Express
    http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=sync&ReleaseId=3762

    Database Sync - SQL Server and SQL Server Compact
    http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=sync&ReleaseId=3422

    Thanks.


    Leo Zhou ------ This posting is provided "AS IS" with no warranties, and confers no rights.
    Thursday, April 1, 2010 5:00 PM
    Answerer
  • aspfun,

    for your step 1, I assume you inserted the random rows on the remote, you sync to local, so the 3 rows get downloaded to client, they both have 3 rows each

    step 2, you delete a row in the remote, when you sync, the deleted row should have been propagated to the client, thus both client and server should have 2 rows each. if you delete a row at one end, the delete operation is propagated, the client will not replace the deleted row with its copy

    in step 3, if step 2 worked, then you should only have 2 rows left in the client. if you delete the two rows in the client, it will be propagated to the server. Now your server has only 2 rows based on step 2. so you should end up with no rows on both servers.

    Are you sure you configured bidirectional sync?

    do a trace using SQL profiler so you see what statements are going up to the server.

    Friday, April 2, 2010 4:02 AM