views:

137

answers:

0

I'm using SyncFramework 1.0 for syncing a SqlCe 2005 database with SqlServer 2005.

I'm setting the Sync anchor like this...

 CommandText = "Select @sync_new_received_anchor = GETUTCDATE()",

but syncframework converts this value to a string with too many decimal places....

exec sp_executesql N'SELECT [Company], [ServiceAreaId], [CostCentreId], [DeletionDate], [DeletionId] 
FROM [ServiceArea_CostCentre_Tombstone] 
WHERE (@sync_initialized = 1 
AND DeletionDate > @sync_last_received_anchor 
AND DeletionDate <= @sync_new_received_anchor 
AND DeletionId <> @sync_client_id)',
N'@sync_initialized bit,@sync_last_received_anchor datetime,
  @sync_new_received_anchor datetime,@sync_client_id uniqueidentifier',
  @sync_initialized=1,
@sync_last_received_anchor='2010-01-27 10:22:01.6770000', -- something wrong here!
@sync_new_received_anchor='2010-01-27 10:23:48.5500000',
@sync_client_id='04F8DB17-981A-4A66-9126-BB609342A2A5'

Sql server logs an error "Error converting data type varchar to datetime." since it only allows three decimal places when converting the string to a DateTime.

I have no idea what is going wrong!