0
votes

I have followed the Microsoft Sync Framework tools and Tutorials.

http://code.msdn.microsoft.com/Sync-Framework-Toolkit-4dc10f0e

I am trying to use SQLite as my client database, for my server i have SQL Server 2008 R2, i provisioned my server database, and i was able to run an example with the browser cache for local storage. but i want to use SQLite database. when clicking on the "sync" button, the SQLite database in the Android devices should be synchronized with SQL Server database. Can you please guide me?

 this.sendRequest = function (serviceUri, successCallback, errorCallback, dir) {

        TraceObj("[" + dir + " Request]:", serviceUri, this.dataObject());
        // Construct HTTP POST request
        var xmlHttp = new XMLHttpRequest();
        xmlHttp.open("POST", serviceUri);
        xmlHttp.setRequestHeader("Accept", "application/json");
        xmlHttp.setRequestHeader("Content-Type", "application/json");
        // Handle success & error response from server and then callback
        xmlHttp.onreadystatechange = function () {
            if (xmlHttp.readyState == 4) {
                if (xmlHttp.status == 200) {
                    var res = new SyncFormatter();
                    if (res.parse(xmlHttp.responseText)) {
                        TraceObj("[" + dir + " Response]:", serviceUri, res.dataObject());
                        alert("[" + dir + " Response]:", serviceUri, res.dataObject());
                        successCallback(res);
                        return;
                    }
                }
                TraceMsg("[" + dir + " Response Error]: ", xmlHttp.status + " Response: " + xmlHttp.responseText);
                errorCallback(xmlHttp.responseText);
            }
        };
        xmlHttp.send(this.toString());
    };
}

In the above i'm getting xmlHttp.status is 500.

1

1 Answers

0
votes

there is not out-of-the-box sync provider for SQLLite, so if you want to use that as your client database, you will have to build one by yourself.

If you have downloaded the Sync Framework Toolkit, you will find a sample sync provider for SQL CE that you can use to follow when writing your own SQLLite sync provider.