title: Microsoft Sync Framework Offline Storage with SQLite Database
body: <p>I have followed the Microsoft Sync Framework tools and Tutorials.</p>
  
  <p><a href="http://code.msdn.microsoft.com/Sync-Framework-Toolkit-4dc10f0e" rel="nofollow">http://code.msdn.microsoft.com/Sync-Framework-Toolkit-4dc10f0e</a></p>
  
  <p>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. <code>when clicking on the "sync" button, the SQLite database in the Android devices should be synchronized with SQL Server database</code>. Can you please guide me?</p>
  
  <pre><code> 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 &amp; 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());
      };
  }
  </code></pre>
  
  <p>In the above i'm getting <strong>xmlHttp.status is 500.</strong></p>