0
我試圖在我的移動設備和數據庫服務器之間創建同步。我正在關注this tutorial,它在sych()函數中獲得ArgumentNullException Value can not be null. Parameter name: ServerSyncProvider
。針對移動設備的ADO.NET解決方案的同步服務 - ArgumentNullException
代碼
private void Sync()
{
Cursor.Current = Cursors.WaitCursor;
WebReference.NorthwindCacheSyncService svcProxy = new WebReference.NorthwindCacheSyncService();
Microsoft.Synchronization.Data.ServerSyncProviderProxy syncProxy =
new Microsoft.Synchronization.Data.ServerSyncProviderProxy(svcProxy);
// Call SyncAgent.Synchronize() to initiate the synchronization process.
// Synchronization only updates the local database, not your project's data source.
NorthwindCacheSyncAgent syncAgent = new NorthwindCacheSyncAgent();
Microsoft.Synchronization.Data.SyncStatistics syncStats = syncAgent.Synchronize();
// TODO: Reload your project data source from the local database (for example, call the TableAdapter.Fill method).
// Show synchronization statistics
MessageBox.Show("Changes downloaded: " + syncStats.TotalChangesDownloaded.ToString()
+ "\r\nChanges Uploaded: " + syncStats.TotalChangesUploaded.ToString());
Cursor.Current = Cursors.Default;
}