locked
DB Sync Sql Server With Sql CE RRS feed

  • Question

  • hi

    I have done Synchrnoization of Sql Azure with Sql CE(at client end) and it is working fine. I am also doing filteration while doing the synchronization and it is also working fine.

     

    I am using <a href="http://msdn.microsoft.com/en-us/library/bb726015(SQL.105).aspx">this "</a> code for this purpose.

    I thing i dont to happed is deletion of previous SqlCE file and then creating the new one and updating the DB with the one on azure.

    Can you please tell me how to stop this deletion and updating the Client DB wihout it.please reply me ASAP.

     

    Samee Javaid

    Friday, May 21, 2010 10:04 AM

Answers

All replies

  • have you commented out the code from the Utilility class the recreates the compact database? Also, you can change the CreationOption property from TableCreationOption.DropExistingOrCreateNewTable.
    Friday, May 21, 2010 3:23 PM
  • Well if we comment the deleteandrecreate code still it doesnt work well...it will update the new records entered at server side but it wont update the deleted records and will keep the deleted records in db. and the CreationOption property is also set as DropExistingOrCreateNewTable already.

     

    Tell me some other solution please......

     

    thanks

     

    Samee Javaid

    Monday, May 24, 2010 6:48 AM
  • Well let me explain you my problem again with an example.

    Suppose i have a Sql Table named as Student and it contains total 5 records at server side and after synchronization all of the records and tables will be moved at client side.

     

    Now suppose after synchronization i deleted two recrods from student table and den again i do the synchronization the deleted records will not be deleted from the client side unless we deleted the client side file and create it again and then do the synchronization

     

    so is there any way we can do this without deleting the file at client side.

     

    Kindly tell me the solution ASAP.

    Wednesday, May 26, 2010 8:07 AM
  • can you trace your code to check if SyncFx is picking the changes (deletes) on the server provider (ChangesSelected event) and check on the client provider as well if it is being applied (ApplyingChanges, ApplyChangeFailed, ChangesApplied)
    Wednesday, May 26, 2010 10:31 AM
  • I have cheecked all the statistics and thing is correct...

    but what I want is......

     

    When i synchrnoize the dbs.... client end db should delete the records which are not being downloaded from the server side....it should not append the records at client side....

    If I delete the client end DB and then reacreate it...then it works fine...but I cant delete the DB at client side because it is being in use by some other application

     

    Thursday, May 27, 2010 6:57 AM
  • apologies, but am lost with what you're trying to achieve.

    just to clarify:

    When you delete a record on the server, do you want that deleted on the client?

    or

    You dont want delete on the server to be cascaded or applied on the client?

     

    When you have new records on the server, do you want to apply that to the client?

    When you have updates on the server, do you want to apply the updates to the client?

     

    Thursday, May 27, 2010 7:27 AM
  • When you delete a record on the server, do you want that deleted on the client?

     

    yes

    When you have new records on the server, do you want to apply that to the client?

    yes

    When you have updates on the server, do you want to apply the updates to the client?

    yes

    Thursday, May 27, 2010 7:35 AM
  • ok. now you're problem is that deletes are not cascaded to the client? is that right?

    have you checked your SelectIncrementalDeletes SQL command?

    Thursday, May 27, 2010 7:58 AM
  • ohk i think this was the problem....can you please give me a sample code for SelectIncrementalDeletes so that i can check if the problem is being resolved by this or not....

     

    I will change the querry accroding to mine....

    Thursday, May 27, 2010 8:25 AM
  • hey...

     

    you didnt reply me...

    any ways i have another confusion regarding to this Sync technique.

    Lets suppose i have multiple clients Client1, Client2 and Client3

    suppose client1 is adding some items from web interface and he press the Save / release button and all the records are saved into the Database. Now the database at server has new value in tombstone table and this means all Client1s Database should be updated. But this wont update only client1s DB it will update the Db for all clients. I want to avoid this.

    If  i have 100 clients and all of them are using only one DB at server. 1 clients updation will cause will every client to update the Database which is not a good technique.

     

    tell me some solution for this.

     

     

    Wednesday, June 2, 2010 6:00 AM
  • for your SelectIncrementalDeletes, you mentioned you're doing filtering so check if you're filter is working.

    if you dont want changes from the server propagating to all clients, specify a filter that the client passes before synchronizing so they only donwload rows that are specific to them. you may look up How to: Filter Rows and Columns  in the documenation on how to go about it.

    Wednesday, June 2, 2010 11:53 AM
  • and btw, the tombstone table is only populated by Deletes.
    Wednesday, June 2, 2010 11:54 AM