Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8115389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:28:10+00:00 2026-06-06T03:28:10+00:00

I’m working with a moderately sized database of about 60,000 records. I am working

  • 0

I’m working with a moderately sized database of about 60,000 records. I am working on building a mobile application which will be able to check out a single table into a compact .sdf on for viewing and altering on the device, then allow the user to sync their changes back up with the main server and receive any new information.

I have set it up with the Sync Framework using a WCF Service Library. When setting up the connection for some reason the database won’t let me check “Use SQL Server Change Tracking” and throws up the error:

“‘Unable to initialize the client database, because the schema for table ‘Inventory’ could >not be retrieved by the GetSchema() method of DbServerSyncProvider. Make sure that you can >establish a connection to the client database and that either the >SelectIncrementalInsertsCommand property or the SelectIncrementalUpdatesCommand property of >the SyncAdapter is specified correctly.”

So I leave it unchecked and set it to use some already created columns “AddDateTime” and “LastEditTime” it seems to work okay, and after a massive amount of tweaking I have it partially working. The changes on the device sync up perfectly with the database, updates, deletes, all get applied. However, changes on the server side…never get updated. I’ve made sure everything is set up right with the bidirectional setup so that shouldn’t be the problem. And, I let it sit overnight so the database received ~500 new records, this morning it actually synced the latest 24 entries to the database…out of 500 new. So that should be further proof that it’s able to receive information from the server, but for all useful purposes, it’s not.

I’ve tried pretty much everything and I’m honestly getting close to losing it. If anyone has any ideas they can throw out I can chase after I would be most grateful.

I’m not sure if I just need to go back and figure out why I can’t do it with the “SQL Server Change Tracking”. Or if there is a simple explanation for why it’s not actually syncing 99% of the changes on the server back to the client.

Also, the server database table schema can’t be altered as a lot of other services use it. But the compact database can be whatever the heck in needs to be to just store the table and sync properly in both directions.

Thank you!!

Quick Overview:

  • Using WCF and syncing without SQL Server Change Tracking (Fully enabled on server and database)
  • Syncing changes from client to server works perfectly
  • Syncing from server back to the client not so much: out of 500 new entries overnight, on a sync it downloaded 24.

EDIT: JuneT got me thinking about the time and their anchors. When I synced this morning it pulled 54 of about 300 new added records. I went in to the line (there are about 60 or so columns, so I removed them for readability, this is kind of a joke)

this.SelectIncrementalUpdatesCommand.CommandText = @”SELECT [Value], [Value], [Value] FROM >TABLE WHERE ([LastEditDate] > @sync_last_received_anchor AND [LastEditDate] <= >@sync_new_received_anchor AND [AddDateTime] <= @sync_last_received_anchor)”;

And replaced @sync_last_received_anchor with two DIFFERENT times. Upon syncing it now returns the rows trapped between those two and took out the middle one giving me:

this.SelectIncrementalUpdatesCommand.CommandText = @”SELECT[Value], [Value], [Value] FROM >TABLE WHERE ([LastEditDate] > ‘2012-06-13 01:03:07.470’ AND [AddDateTime] <= ‘2012-06-14 >08:54:27.727’)”; (NOTE: The second date is just the current time now)

Though it returned a few hundred more rows than initially planned (set the date gap for 600, it returned just over 800). It does in fact sync the client up with the the new server changes.

Can anyone explain why I can’t use @sync_last_received_anchor and what I should be looking for. I suppose I could always add box that allows the user to select the date to begin updating from? Or maybe add some sort of xml file to store the sync date that would be updated anytime a sync was -successfully- completed?

Thanks!

EDIT:
Ran the SQL profiler on it…the date (@sync_last_received_anchor) is getting set to 8 hours ahead of whatever time it really is. I have no idea how or why it’s doing this, but that would definitely make sense.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T03:28:13+00:00Added an answer on June 6, 2026 at 3:28 am

    Turns out the anchors are collected like this:

    this.SelectNewAnchorCommand.CommandText = “Select @sync_new_received_anchor = GETUTCDATE()”;

    That UTC date is what was causing the 8 hours gap. To fix it either change it to GETDATE(), or convert your columns to UTC time in the WHERE clause of the commands.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have an autohotkey script which looks up a word in a bilingual dictionary
I'm trying to select an H1 element which is the second-child in its group

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.