共用方式為


InternetPassword 屬性

指定連接到 SQL Server Compact 3.5 伺服器代理程式時所使用的 Microsoft Internet Information Services (IIS) 密碼。

命名空間:  System.Data.SqlServerCe
組件:  System.Data.SqlServerCe (在 System.Data.SqlServerCe.dll 中)

語法

'宣告
Public Property InternetPassword As String
    Get
    Set
'用途
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);
}
member InternetPassword : string with get, set
function get InternetPassword () : String
function set InternetPassword (value : String)

屬性值

型別:System. . :: . .String
連接到 SQL Server Compact 3.5 伺服器代理程式時使用的 IIS 密碼字串。預設為沒有密碼。

備註

如果 SQL Server Compact 3.5 伺服器代理程式是設定為使用基本驗證或整合式 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/sqlcesa35.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/sqlcesa35.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();
}

請參閱

參考

SqlCeRemoteDataAccess類別

SqlCeRemoteDataAccess 成員

System.Data.SqlServerCe 命名空間