SqlCeRemoteDataAccess.Pull Method
Note: This namespace, class, or member is supported only in version 1.1 of the .NET Framework.
Overload List
Extracts data from a SQL Server database and stores it in a table in a SQL Server CE database.
Supported only by the .NET Compact Framework.
[Visual Basic] Overloads Public Sub Pull(String, String, String)
Extracts data from a SQL Server database and stores it in a table in a SQL Server CE database. Specifies whether index information should be included and if changes made to the pulled table should be tracked.
Supported only by the .NET Compact Framework.
[Visual Basic] Overloads Public Sub Pull(String, String, String, RdaTrackOption)
[C#] public void Pull(string, string, string, RdaTrackOption);
[C++] public: void Pull(String*, String*, String*, RdaTrackOption);
[JScript] public function Pull(String, String, String, RdaTrackOption);
Extracts data from a SQL Server database and stores it in a table in a SQL Server CE database.
Supported only by the .NET Compact Framework.
[Visual Basic] Overloads Public Sub Pull(String, String, String, RdaTrackOption, String)
[C#] public void Pull(string, string, string, RdaTrackOption, string);
[C++] public: void Pull(String*, String*, String*, RdaTrackOption, String*);
[JScript] public function Pull(String, String, String, RdaTrackOption, String);
Example
[Visual Basic, C#] Note This example shows how to use one of the overloaded versions of Pull. For other examples that might be available, see the individual overload topics.
' Connection String to the SQL Server.
Dim rdaOleDbConnectString As String = _
"Provider=sqloledb; Data Source=MySqlServer;Initial Catalog=Northwind; " + _
"User Id=username;Password = <password>"
' Initialize RDA Object.
Dim rda As SqlCeRemoteDataAccess = Nothing
Try
'Try the Pull Operation.
rda = New SqlCeRemoteDataAccess()
rda.InternetLogin = "MyLogin"
rda.InternetPassword = "<password>"
rda.InternetUrl = "<http://www.northwindtraders.com/sqlce/sscesa20.dll>"
rda.LocalConnectionString = "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data Source=\ssce.sdf"
rda.Pull("Employees", "Select * from Employees", _
rdaOleDbConnectString, _
RdaTrackOption.TrackingOnWithIndexes, _
"ErrorTable")
Catch e As SqlCeException
'Use you own Error Handling Routine.
'ShowErrors(e);
Finally
'Dispose of the RDA Object.
rda.Dispose()
End Try
[C#]
// Connection String to the SQL Server.
string rdaOleDbConnectString = "Provider=sqloledb; Data Source=MySqlServer;Initial Catalog=Northwind; " +
"User Id=username;Password = <password>";
// Initialize RDA Object.
SqlCeRemoteDataAccess rda = null;
try {
//Try the Pull Operation.
rda = new SqlCeRemoteDataAccess();
rda.InternetLogin = "MyLogin";
rda.InternetPassword = "<password>";
rda.InternetUrl = "<http://www.northwindtraders.com/sqlce/sscesa20.dll>";
rda.LocalConnectionString = @"Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data Source=\ssce.sdf";
rda.Pull(
"Employees",
"Select * from Employees",
rdaOleDbConnectString,
RdaTrackOption.TrackingOnWithIndexes ,
"ErrorTable");
}
catch(SqlCeException) {
//Use you own Error Handling Routine.
}
finally {
//Dispose of the RDA Object.
rda.Dispose();
}
[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button in the upper-left corner of the page.
See Also
SqlCeRemoteDataAccess Class | SqlCeRemoteDataAccess Members | System.Data.SqlServerCe Namespace