Synchronize two SQLite Database by WPF, C# RRS feed

  • Question

  • In my application I have a local and a server database. Both of them are SQLite DBs. I need to sync those (bidirectional sync, i.e from server to client and client to server) using C# code. There are n number of local system and one server.

    My Requirement is user will trigger the sync operation, I mean by any button click event. Application can't sync automatically. Not even at the time of application load.

    I have searched for Microsoft Sync Framework, but its not possible for me to use it as all the local systems that will use the application will not have sync framework installed.

    The below scenerios should be supported by the code :

    1. If a new record is inserted in a table in server the same should come in the local after user triggers sync.
    2. If a new record is inserted in a table in local the same should come in the server after user triggers sync.
    3. If a record is inserted both in server and client, both should sync and new records inserted in both.
    4. if a record is updated it should also sync.

    I have tried to use dataset object using disconnected architechture of ADO.NET but taking whole data is a performance overhead.

    I am using .NET 4.0, Platform x86 and a WPF application

    Wednesday, March 20, 2013 2:51 PM