Construtor SqlCeRemoteDataAccess (String, String)
Inicializa uma nova instância do objeto SqlCeRemoteDataAccess e a configura para o acesso anônimo aos Serviços de Informações da Internet da Microsoft (IIS).
Namespace: System.Data.SqlServerCe
Assembly: System.Data.SqlServerCe (em System.Data.SqlServerCe.dll)
Sintaxe
'Declaração
Public Sub New ( _
internetUrl As String, _
localConnectionString As String _
)
'Uso
Dim internetUrl As String
Dim localConnectionString As String
Dim instance As New SqlCeRemoteDataAccess(internetUrl, _
localConnectionString)
public SqlCeRemoteDataAccess(
string internetUrl,
string localConnectionString
)
public:
SqlCeRemoteDataAccess(
String^ internetUrl,
String^ localConnectionString
)
new :
internetUrl:string *
localConnectionString:string -> SqlCeRemoteDataAccess
public function SqlCeRemoteDataAccess(
internetUrl : String,
localConnectionString : String
)
Parâmetros
- internetUrl
Tipo: System. . :: . .String
A URL usada para conectar o Agente de Servidor do SQL Server Compact 3.5.
- localConnectionString
Tipo: System. . :: . .String
A cadeia de conexão OLE DB para o banco de dados do SQL Server Compact 3.5.
Comentários
Este construtor inicializa as propriedades InternetUrl e LocalConnectionString. Os valores padrão são atribuídos à outras propriedades. Em seguida, é possível alterar o valor de qualquer propriedade.
Exemplos
' 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/sscesa35.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/sscesa35.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();
}