'Exemple permettant de récupérer des données du PC vers le Pocket via RDA
Code :
Public Sub Synchronise(ByVal NomTable As String, ByVal ChaineSQL As String, ByVal OptionSuivi As RdaTrackOption)
' Connection String to the SQL Server.
Dim rdaOleDbConnectString As String = _
"Provider=sqloledb; Data Source=BARTON\MSDE;Initial Catalog=ValTrace; " + _
"User Id=sa; Password = admin"
' Initialize RDA Object.
Dim rda As SqlCeRemoteDataAccess = Nothing
Try
'Try the Pull Operation.
rda = New SqlCeRemoteDataAccess
rda.InternetLogin = ""
rda.InternetPassword = ""
rda.InternetUrl = "http://192.168.0.101/sqlce/sscesa20.dll"
rda.LocalConnectionString = "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data Source=\My documents\Datas\valpocket.sdf"
rda.Pull(NomTable, ChaineSQL, rdaOleDbConnectString, OptionSuivi)
Catch e As SqlCeException
'Use you own Error Handling Routine.
MessageBox.Show(e.Message)
Finally
'Dispose of the RDA Object.
rda.Dispose()
End Try
End Sub