data sync

pips06

New member
Joined
Aug 30, 2008
Messages
4
Programming Experience
Beginner
Hi, i was wondering whether anybody could assist with an issue im having with my smart device application.

Basically, i've created a smart device application that utilises SQL CE. I want to be able to enter information into my client database (on the smart device)and then sync it back to my sql express database. My application is working fine although the problem im facing is when it comes to sync'ing the updates i've made to the server.
Im relatively new to vb.net and data synchronization but have been following a number of walkthroughs for OCS applications.

Anyhow, when i try to initiate the bi-directional sync i get the following error,

"Value can not be null. Parameter name: ServerSyncProvider"

This is the code im using to initiate the sync,

VB.NET:
   Private Sub NewMenuItemMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NewMenuItemMenuItem1.Click

        Dim syncAgent As WQACacheSyncAgent = New WQACacheSyncAgent()
        Dim syncStats As Microsoft.Synchronization.Data.SyncStatistics = syncAgent.Synchronize()

        Me.WATERQUALITYASSURANCEDataSet.Customer.Merge(CustomerTableAdapter.GetData())

    End Sub

Any assistance would be greatly appreciated.

Ben.
 
Last edited by a moderator:
I've never used sync, so this answer is a little woolly. Somewhere in your code, one of the classes youre using an instance of, has a parameter to a method or constructor that sets the value of the Property called ServerSyncProvider and you are not calling that method or constructor, or you are not setting the value of the ServerSyncProvider property before attempting to use the class.

Google doesnt know what a WQACacheSyncAgent is but guessing that it was a derivative of SyncAgent, I looked up the docs. The only thing I see in reference to w.r.t to ServerSyncProvider is the "RemoteProvider" property.

As hence a wild stab in the dark at your problem:

You declare a new sync agent, appear not to set any properties on it, and then call for it to be used. Given that a microsoft class would never be called WQACacheSyncAgent because this violates the .NET naming conventions (Correct: WqaCache...) I assume this is a class you have crafted yourself or obtained elsewhere as an inherited member from SyncAgent. Somewhere in the implementation of that class, a vital setting has been neglected. Examine settings that relate to the remote side of the sync, especially any properties that get or set a ServerSyncProvider or one of its derived classes
 
Value can not be null. Parameter name: ServerSyncProvider

as the error says "Value can not be null. Parameter name: ServerSyncProvider"
Means it is not initialized
you have left one line of code inbetween

Dim svcProxy As New synchronizationDC.POSSyncService()
Dim syncProxy As New Microsoft.Synchronization.Data.ServerSyncProviderProxy(svcProxy)

Dim syncAgent As WQACacheSyncAgent = New WQACacheSyncAgent()

syncAgent.RemoteProvider = syncProxy
Dim syncStats As Microsoft.Synchronization.Data.SyncStatistics = syncAgent.Synchronize()

you can follow the link
Building a Sync Services for ADO.NET Solution for Mobile Devices - Andy Wigley - APPA Mundi


Hope this helps :)
 
Back
Top