Condividi tramite


SqlCeRemoteDataAccess Constructor (String, String, String, String)

Note: This namespace, class, or member is supported only in version 1.1 of the .NET Framework.

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

  [Visual Basic]
  Public Sub New( _
   ByVal 
  internetUrl
   As String, _
   ByVal internetLogin As String, _
   ByVal internetPassword As String, _
   ByVal localConnectionString As String _
)
[C#]
public SqlCeRemoteDataAccess(
   string internetUrl,string internetLogin,string internetPassword,string localConnectionString
);
[C++]
public: SqlCeRemoteDataAccess(
   String* internetUrl,String* internetLogin,String* internetPassword,String* localConnectionString
);
[JScript]
public function SqlCeRemoteDataAccess(
   internetUrl : String,
 internetLogin : String,
 internetPassword : String,
 localConnectionString : String);

Parameters

  • internetUrl
    The URL used to connect to the SQL Server CE Server Agent.
  • internetLogin
    The login name used when connecting to the SQL Server CE Server Agent.
  • internetPassword
    The password used when connecting to the SQL Server CE Server Agent.
  • localConnectionString
    The OLE DB connection string for the SQL Server CE database.

Remarks

This constructor initializes 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.

Example

  [Visual Basic] 
' 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 Language Filter in the upper-left corner of the page.

Requirements

Platforms: .NET Compact Framework

.NET Framework Security:

See Also

SqlCeRemoteDataAccess Class | SqlCeRemoteDataAccess Members | System.Data.SqlServerCe Namespace | SqlCeRemoteDataAccess Constructor Overload List

Syntax based on .NET Framework version 1.1.
Documentation version 1.1.1.

Send comments on this topic.

© Microsoft Corporation. All rights reserved.