Hi,
I was implementing an N-Tier solution with the CTP version. Everything was ok. Today I've installed VS.2008 SP1 and Sync Framework RTM. Now I am getting the error
Unable to initialize the client database, because the schema for table 'SomeTable' 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.
What I undrstand is, there was no need to configure a SqlSyncAdapterBuilder before getting schema in CTP version. But in RTM it is a must. I want to ask if it is true or not and if it is true, why? Regards.
The code which is working with CTP version:
Code Snippet
Public
Class ServerSyncProvider
Inherits DbServerSyncProvider
Public Sub New()
Me.Connection = New SqlClient.SqlConnection("Data Source=.;Initial Catalog=FGF;Persist Security Info=True;Integrated Security=SSPI")
Dim selectNewAnchorCommand As New SqlCommand()
Dim newAnchorVariable As String = "@" + SyncSession.SyncNewReceivedAnchor
selectNewAnchorCommand.CommandText = "select " & newAnchorVariable & " = GETUTCDATE()"
selectNewAnchorCommand.Parameters.Add(newAnchorVariable, SqlDbType.DateTime)
selectNewAnchorCommand.Parameters(newAnchorVariable).Direction = ParameterDirection.Output
selectNewAnchorCommand.Connection = Me.Connection
Me.SelectNewAnchorCommand = selectNewAnchorCommand
End Sub
Public Overrides Function GetSchema(ByVal tableNames As System.Collections.ObjectModel.Collection(Of String), ByVal syncSession As Microsoft.Synchronization.Data.SyncSession) As Microsoft.Synchronization.Data.SyncSchema
Return MyBase.GetSchema(tableNames, syncSession)
End Function
End Class
References in business services layer (server)
Microsoft.Synchronization 1.0.0.0
Microsoft.Synchronization.Data 2.0.0.0
Microsoft.Synchronization.Data.Server 2.0.0.0
References in UI layer (client)
Microsoft.Synchronization 1.0.0.0
Microsoft.Synchronization.Data 2.0.0.0
Microsoft.Synchronization.Data.SqlServerCe 2.0.0.0
System.Data.SqlServerCe 3.5.1.0