Domanda

I'm working an OCA application based on a SQL server db and a SQL CE client db. Each user has there own table in the on the SQL server db. Each user's table has the same schema but can have different data. I'd like to make the synctable name to be dynamically set in the client application based on the their SQL server DB table name (which is set as userID + "__usersdatatable").

The sync service runs without problems when I don't attempt to change anything. My latest idea was to change SyncTable.TableName = "jsmith_usersdatatable"; in the LocalDataCache1SyncAgent.cs in the oninitialized() method. However, I get the following error:

"Unable to initialize the client database, because the schema for table 'zlentz_GOBOS' 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."

In short the idea is that each OCA will need to sync to a different table (bidirectional). I'm obviously no SQL or sync Services expert so advice would helpful. :) Thanks in advanced!

È stato utile?

Soluzione

After learning more about the Sync Framework it was apparent that I needed to work outside the wizard.

For future viewers the following link was very helpful:

http://www.codeproject.com/Articles/18027/Take-Data-Offline-Using-Microsoft-Synchronization

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top