Export (0) Print
Expand All

SqlCeRemoteDataAccess Constructor (String, String, String, String)

Initializes a new instance of the SqlCeRemoteDataAccess object and configures it for a Basic or Integrated Windows authentication to Internet Information Services (IIS).

Namespace:  System.Data.SqlServerCe
Assembly:  System.Data.SqlServerCe (in System.Data.SqlServerCe.dll)

public SqlCeRemoteDataAccess(
	string internetUrl,
	string internetLogin,
	string internetPassword,
	string localConnectionString


Type: System..::..String
The URL used to connect to the Server Agent.
Type: System..::..String
The login name used when connecting to the Server Agent.
Type: System..::..String
The password used when connecting to the Server Agent.
Type: System..::..String
The OLE DB connection string for the database.

This constructor initializes the InternetUrl, InternetLogin, InternetPassword, and LocalConnectionString properties. The rest of the properties are assigned their default values. You then can change the value for any property.

// 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/sscesa35.dll>";
    rda.LocalConnectionString  = @"Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data Source=\ssce.sdf";

        "Select * from Employees", 
        RdaTrackOption.TrackingOnWithIndexes , 
catch(SqlCeException) {
    //Use you own Error Handling Routine.
finally {
    //Dispose of the RDA Object.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft