SqlCeRemoteDataAccess.SqlCeRemoteDataAccess(String, String, String, String) Constructor
Initializes a new instance of the SqlCeRemoteDataAccess object and configures it for a Basic or Integrated Windows authentication to Microsoft Internet Information Services (IIS).
Namespace: System.Data.SqlServerCe
Assembly: System.Data.SqlServerCe (in system.data.sqlserverce.dll)
Syntax
'Declaration
Public Sub New ( _
internetUrl As String, _
internetLogin As String, _
internetPassword As String, _
localConnectionString As String _
)
'Usage
Dim internetUrl As String
Dim internetLogin As String
Dim internetPassword As String
Dim localConnectionString As String
Dim instance As New SqlCeRemoteDataAccess(internetUrl, internetLogin, internetPassword, localConnectionString)
public SqlCeRemoteDataAccess (
string internetUrl,
string internetLogin,
string internetPassword,
string localConnectionString
)
public:
SqlCeRemoteDataAccess (
String^ internetUrl,
String^ internetLogin,
String^ internetPassword,
String^ localConnectionString
)
public SqlCeRemoteDataAccess (
String internetUrl,
String internetLogin,
String internetPassword,
String localConnectionString
)
public function SqlCeRemoteDataAccess (
internetUrl : String,
internetLogin : String,
internetPassword : String,
localConnectionString : String
)
Not applicable.
Parameters
- internetUrl
The URL used to connect to the SQL Server Compact Edition Server Agent.
- internetLogin
The login name used when connecting to the SQL Server Compact Edition Server Agent.
- internetPassword
The password used when connecting to the SQL Server Compact Edition Server Agent.
- localConnectionString
The OLE DB connection string for the SQL Server Compact Edition database.
Remarks
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.
Example
' 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
// 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();
}
Platforms
Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows XP Professional x64 Edition, Windows XP SP2
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.
Version Information
.NET Framework
Supported in: 3.0
.NET Compact Framework
Supported in: 2.0, 1.0
See Also
Reference
SqlCeRemoteDataAccess Class
SqlCeRemoteDataAccess Members
System.Data.SqlServerCe Namespace