メモ : この名前空間、クラス、およびメンバは、.NET Framework Version 1.1 だけでサポートされています。
SqlCeRemoteDataAccess オブジェクトの新しいインスタンスを初期化し、Microsoft インターネット インフォメーション サービス (IIS) への匿名アクセスを設定します。
Public Sub New( _
ByVal internetUrl As String, _ ByVal localConnectionString As String _)
[C#]
public SqlCeRemoteDataAccess(
stringinternetUrl,stringlocalConnectionString);
[C++]
public: SqlCeRemoteDataAccess(
String* internetUrl,String* localConnectionString);
[JScript]
public function SqlCeRemoteDataAccess(
internetUrl : String,localConnectionString : String);
パラメータ
- internetUrl
SQL Server CE サーバー エージェントに接続するときに使用する URL。 - localConnectionString
SQL Server CE データベースに接続するための OLE DB 接続文字列。
解説
このコンストラクタは InternetUrl プロパティと LocalConnectionString プロパティを初期化します。それ以外のプロパティには、既定値が代入されます。後から、任意のプロパティの値を変更できます。
使用例
' 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] C++ および JScript のサンプルはありません。Visual Basic および C# のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: .NET Compact Framework - Windows CE .NET
.NET Framework セキュリティ:
- 直前の呼び出し元の完全信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細の参照先 : 部分信頼コードからのライブラリの使用
参照
SqlCeRemoteDataAccess クラス | SqlCeRemoteDataAccess メンバ | System.Data.SqlServerCe 名前空間 | SqlCeRemoteDataAccess コンストラクタのオーバーロードの一覧