Answered by:
Bidirectional Synchronization between Compact and SQL Server DB in Windows Mobile 6.5

Question
-
I followed the link http://mobileworld.appamundi.com/blogs/andywigley/archive/2008/12/08/building-a-sync-services-for-ado-net-solution-for-mobile-devices.aspx
and was able to sync DB.
Problem is that it is only for static connection string and Server IP where SQL server DB is located which i provided through designer wizard. now i want to change the connection string and Server IP as provided in some file.So that user can change the Server DB location and synchronize.I don't know how to proceed.Please Help
Tuesday, June 26, 2012 9:25 AM
Answers
-
Mine problem has been sort out.
I was not using SQL server 2008 while mine replicated Compact DB was made from SQL server 2008.
Also the schema of databases were mismatched.
Thanks for your guidance
- Marked as answer by Vandana2011it Monday, July 9, 2012 12:53 PM
Monday, July 9, 2012 12:53 PM
All replies
-
you can simply repoint a client from one server to another. the client saves a received anchor that represents the last timestamp it receive from the server and this timestamp can differ between servers and may result to your client not getting changes at all.
assuming the sync recorded a last received anchor of 100, when it queries for changes, it will ask for changes whose timestamp is greater than 100.
if you happen to repoint to a server whose timestamp is just at 50, then you dont get any changes.
if you have to repoint, you have to reinitialize the client again.- Edited by JuneT Tuesday, June 26, 2012 10:15 AM
Tuesday, June 26, 2012 10:14 AM -
Thanks for your quick response.
Could you please suggest me how to proceed with bidirectional DB synchronization in visual studio smart device application.
Tuesday, June 26, 2012 10:51 AM -
what you're doing is already fine. what am saying is you cannot repoint a client to a new server without reinitializing the client database.Tuesday, June 26, 2012 11:55 PM
-
June i am a bit new to synchronization.
I did the following things till now :
1. I hosted the WEB SERVICE on IIS . It works fine for the server through which i created through sync.
2.Now when i change the server location and point to another DB it gives error.
What i understood from your explanation is that :
1.For the first time when it synchronizes through designer it creates a fresh Client Database which it syncs from the server end.It is neccessary because the client saves a received anchor that represents the last timestamp it received from the server .
2.Because of this when i tried to change the web.config of WCF service library i was getting the error
"Unable to obtain a new server anchor. Make sure that you can establish a connection to the server database and that the SelectNewAnchorCommand property of the DbServerSyncProvider is specified correctly".
- Edited by Vandana2011it Thursday, June 28, 2012 6:08 AM
Thursday, June 28, 2012 6:07 AM -
To resolve the error
"Unable to obtain a new server anchor. Make sure that you can establish a connection to the server database and that the SelectNewAnchorCommand property of the DbServerSyncProvider is specified correctly"
What i need to do is :
When ever there is change in server address or anchor i need to delete the previous DB and recreate the fresh one through code then synchronize.Hope the above error will not come after that.
Am I right ? Please Guide me...
Please share the links on how to write the code for the above if my understanding is correct.
Thursday, June 28, 2012 6:16 AM -
if you used the built-in SQL Change Tracking in the Local Database Cache Wizard, have you enabled SQL Change Tracking on the other database?
i suggest you check out the documentation that gets installed with the Sync Framework SDK as these are all covered in the docs.
Thursday, June 28, 2012 8:12 AM -
Thanks
I am going through the documents first.
Thursday, June 28, 2012 10:03 AM -
I am still struggling with the error "Unable to obtain a new server anchor. Make sure that you can establish a connection to the server database and that the SelectNewAnchorCommand property of the DbServerSyncProvider is specified correctly".
Don't know how to solve.
Thursday, July 5, 2012 5:46 AM -
does it work if you're not changing connection strings? if you're using windows integrated security to connect to your sql server, under which account is the wcf service running? can you connect to your sql server from the same machine where you have the WCF service?Friday, July 6, 2012 11:35 AM
-
Mine problem has been sort out.
I was not using SQL server 2008 while mine replicated Compact DB was made from SQL server 2008.
Also the schema of databases were mismatched.
Thanks for your guidance
- Marked as answer by Vandana2011it Monday, July 9, 2012 12:53 PM
Monday, July 9, 2012 12:53 PM