GetSchema() returns error when SyncDirection is UploadOnly
I am in the process of running through the N-Tier example and have run into a problem. I have successfully run a test using Bi-Directional syncing through an asp.net webservice, however, when I try to test the UploadOnly Sync Dircection I receive the following error from the Web Service:
"Microsoft.Synchronization.Data.SchemaException: Unable to initialize the client database, because the schema for table 'Orders' 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. "
Here is the constructor of the WebService.
PublicSubNew()
_objServerProvider =New DbServerSyncProvider()
Dim objBuilderAsNew SqlConnectionStringBuilder
'1. Prepare server db connection and attach it to the sync agent
objBuilder("Data Source") ="MyServer"
objBuilder("Integrated Security") =True
objBuilder("Initial Catalog") ="pub"
_objServerProvider.Connection = objSQLConnection' 2. Create sync adapter for each sync table and attach it to the agent
Dim objOrdersBuilderAsNew SqlSyncAdapterBuilder
objOrdersBuilder.Connection = objSQLConnection
objOrdersBuilder.SyncDirection = SyncDirection.UploadOnly
objOrdersBuilder.TableName ="orders"
objOrdersBuilder.DataColumns.Add("order_id")
objOrdersBuilder.DataColumns.Add("order_date")
objOrdersBuilder.TombstoneTableName ="orders_tombstone"
objOrdersBuilder.TombstoneDataColumns.Add("order_id")
objOrdersBuilder.TombstoneDataColumns.Add("order_date")
objOrdersBuilder.CreationTrackingColumn ="create_timestamp"
objOrdersBuilder.UpdateTrackingColumn ="update_timestamp"
objOrdersBuilder.DeletionTrackingColumn ="update_timestamp"
objOrdersBuilder.UpdateOriginatorIdColumn ="update_originator_id"Dim objSyncAdapterAs SyncAdapter = objOrdersBuilder.ToSyncAdapter
IfNot objSyncAdapter.SelectIncrementalInsertsCommandIsNothingThenDim objSQLParameterAs SqlParameter =CType(objSyncAdapter.SelectIncrementalInsertsCommand.Parameters("@sync_last_received_anchor"), SqlParameter)
objSQLParameter.DbType = DbType.Binary
objSyncAdapter.SelectIncrementalInsertsCommand.Parameters("@sync_last_received_anchor") = objSQLParameter
objSQLParameter = (CType(objSyncAdapter.SelectIncrementalInsertsCommand.Parameters("@sync_new_received_anchor"), SqlParameter))objSQLParameter.DbType = DbType.Binary
objSyncAdapter.SelectIncrementalInsertsCommand.Parameters("@sync_new_received_anchor") = objSQLParameter
EndIf
_objServerProvider.SyncAdapters.Add(objSyncAdapter)
' select new anchor commandDim objAnchorCmd =New SqlCommand
objAnchorCmd.CommandType = CommandType.Text
objAnchorCmd.CommandText ="SELECT @@DBTS"
_objServerProvider.SelectNewAnchorCommand = objAnchorCmdDim objMappingCmdAsNew SqlCommand("SELECT 1", objSQLConnection)
objMappingCmd.CommandType = CommandType.Text
objMappingCmd.Parameters.Add(SyncSession.SyncClientId, SqlDbType.UniqueIdentifier)
_objServerProvider.SelectClientIdCommand = objMappingCmd
EndSub
Does anyone have any thoughts as to why this error is occuring?

