SqlCeRemoteDataAccess.InternetPassword 属性

指定在连接到 SQL Server Compact Edition Server Agent 时使用的 Microsoft Internet 信息服务 (IIS) 密码。

命名空间: System.Data.SqlServerCe
程序集: System.Data.SqlServerCe(在 system.data.sqlserverce.dll 中)

语法

声明
Public Property InternetPassword As String
用法
Dim instance As SqlCeRemoteDataAccess
Dim value As String

value = instance.InternetPassword

instance.InternetPassword = value
public string InternetPassword { get; set; }
public:
property String^ InternetPassword {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_InternetPassword ()

/** @property */
public void set_InternetPassword (String value)
public function get InternetPassword () : String

public function set InternetPassword (value : String)
不适用。

属性值

连接到 SQL Server Compact Edition Server Agent 时使用的 IIS 密码字符串。默认为无密码。

备注

如果 SQL Server Compact Edition Server Agent 配置为使用基本身份验证或集成 Windows 身份验证,则需要 InternetPassword 属性。在使用集成 Windows 身份验证时,不通过网络传递 InternetPassword

在使用基本身份验证时,应将 IIS 配置为使用 SSL 或专用通信技术(Private Communication Technology 即 PCT)加密,以确保用户密码安全。如果不使用 SSL 或 PCT 加密,则基本身份验证将在网络中以明文形式传输密码。这样做很不安全;因此,极力建议您在使用基本身份验证时利用 SSL 或 PCT 加密确保密码安全。

示例

下面的示例演示如何设置 SqlCeRemoteDataAccess 对象的 InternetPassword 属性。

' Connection String to the SQL Server
'
Dim rdaOleDbConnectString As String = "Data Source=MySqlServer;Initial Catalog=AdventureWorks; " & _
    "User Id=username;Password = <password>"

' Initialize RDA Object
'
Dim rda As SqlCeRemoteDataAccess = Nothing

Try
    ' Try the Pull Operation
    '
    rda = New SqlCeRemoteDataAccess( _
        "https://www.adventure-works.com/sqlmobile/sqlcesa30.dll", _
        "MyLogin", _
        "<password>", _
        "Data Source=MyDatabase.sdf")

    rda.Pull("Employees", "SELECT * FROM DimEmployee", rdaOleDbConnectString, _
        RdaTrackOption.TrackingOnWithIndexes, "ErrorTable")

    ' or, try one of these overloads:
    ' rda.Pull("Employees", "SELECT * FROM DimEmployee", rdaOleDbConnectString, _
    '     RdaTrackOption.TrackingOnWithIndexes)
    '
    ' rda.Pull("Employees", "SELECT * FROM DimEmployee", rdaOleDbConnectString)

Catch
    ' Handle errors here
    '
Finally
    ' Dispose of the RDA object
    '
    rda.Dispose()
End Try
// Connection String to the SQL Server
//
string rdaOleDbConnectString = "Data Source=MySqlServer;Initial Catalog=AdventureWorks; " +
    "User Id=username;Password = <password>";

// Initialize RDA Object
//
SqlCeRemoteDataAccess rda = null;

try
{
    // Try the Pull Operation
    //
    rda = new SqlCeRemoteDataAccess(
        "https://www.adventure-works.com/sqlmobile/sqlcesa30.dll",
        "MyLogin",
        "<password>",
        "Data Source=MyDatabase.sdf");

    rda.Pull("Employees", "SELECT * FROM DimEmployee", rdaOleDbConnectString,
        RdaTrackOption.TrackingOnWithIndexes, "ErrorTable");

    // or, try one of these overloads:
    //
    // rda.Pull("Employees", "SELECT * FROM DimEmployee", rdaOleDbConnectString,
    //     RdaTrackOption.TrackingOnWithIndexes);
    //
    // rda.Pull("Employees", "SELECT * FROM DimEmployee", rdaOleDbConnectString);
}
catch (SqlCeException)
{
    // Handle errors here
    //
}
finally
{
    // Dispose of the RDA object
    //
    rda.Dispose();
}

平台

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

Windows Vista、Microsoft Windows XP SP2 和 Windows Server 2003 SP1 支持 Microsoft .NET Framework 3.0。

版本信息

.NET Framework

受以下版本支持:3.0

.NET Compact Framework

受以下版本支持:2.0、1.0

请参见

参考

SqlCeRemoteDataAccess 类
SqlCeRemoteDataAccess 成员
System.Data.SqlServerCe 命名空间