我正在尝试使用Microsoft Sync Framework将本地数据库与在线数据库同步,但在尝试同步.SDF文件时,它会在该特定代码行显示以下错误消息时提供无效的强制转换异常。
Public Sub New()
MyBase.New
Me.InitializeSyncProviders()
Me.InitializeSyncTables
Me.OnInitialized
End Sub
当在initializesyncproviders()后面执行第二行代码时抛出异常。该函数后面有代码
<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Private Sub InitializeSyncProviders()
'Create SyncProviders.
Me.RemoteProvider = New LocalDataCache1ServerSyncProvider()
'Dim serverConn As New SqlConnection("Data Source=RSERVER-PC; Initial Catalog=ST_TOKA_04; Integrated Security=false;user=sa;password=123")
'Me.RemoteProvider = New SqlSyncProvider("godownSyncTableSyncGroup", serverConn)
Me.LocalProvider = New LocalDataCache1ClientSyncProvider()
End Sub
它在某一行上给出错误的功能。
Me.RemoteProvider = New LocalDataCache1ServerSyncProvider()