SqlCeReplication.PublisherPassword Property

パブリッシャへの接続時に使用するログイン パスワードを指定します。

名前空間: System.Data.SqlServerCe
アセンブリ: System.Data.SqlServerCe (system.data.sqlserverce.dll 内)

構文

'宣言
Public Property PublisherPassword As String
public string PublisherPassword { get; set; }
public:
property String^ PublisherPassword {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_PublisherPassword ()

/** @property */
public void set_PublisherPassword (String value)
public function get PublisherPassword () : String

public function set PublisherPassword (value : String)

プロパティ値

ログイン パスワード。既定では、パスワードはありません (空の文字列)。

SqlCeReplication オブジェクトの PublisherPassword プロパティを設定する例を次に示します。

Dim repl As SqlCeReplication = Nothing

Try
    ' Instantiate and configure SqlCeReplication object
    '
    'NOTE: when possible, prompt users to enter security 
    'credentials at runtime. If you store credentials in a file, 
    'you must secure the file to prevent unauthorized access.
    '
    repl = New SqlCeReplication()
    repl.InternetUrl = "https://www.adventure-works.com/sqlce/sqlcesa35.dll"
    repl.InternetLogin = "MyInternetLogin"
    repl.InternetPassword = "<enterStrongPassword>"
    repl.Publisher = "MyPublisher"
    repl.PublisherDatabase = "MyPublisherDatabase"
    repl.PublisherLogin = "MyPublisherLogin"
    repl.PublisherPassword = "<enterStrongPassword>"
    repl.Publication = "MyPublication"
    repl.Subscriber = "MySubscriber"
    repl.SubscriberConnectionString = "Data Source=MyDatabase.sdf"

    ' Create the local SQL Mobile Database subscription
    '
    repl.AddSubscription(AddOption.CreateDatabase)

    ' Synchronize to the SQL Server to populate the Subscription 
    '
    repl.Synchronize()
Catch
    ' Handle errors here
    '
Finally
    ' Dispose the repl object
    '
    repl.Dispose()
End Try
SqlCeReplication repl = null;

try
{
    // Instantiate and configure SqlCeReplication object
    //
    //NOTE: when possible, prompt users to enter security 
    //credentials at runtime. If you store credentials in a file, 
    //you must secure the file to prevent unauthorized access.
    //
    repl = new SqlCeReplication();
    repl.InternetUrl = "https://www.adventure-works.com/sqlce/sqlcesa35.dll";
    repl.InternetLogin = "MyInternetLogin";
    repl.InternetPassword = "<enterStrongPassword>";
    repl.Publisher = "MyPublisher";
    repl.PublisherDatabase = "MyPublisherDatabase";
    repl.PublisherLogin = "MyPublisherLogin";
    repl.PublisherPassword = "<enterStrongPassword>";
    repl.Publication = "MyPublication";
    repl.Subscriber = "MySubscriber";
    repl.SubscriberConnectionString = "Data Source=MyDatabase.sdf";

    // Create a local SQL Mobile Database subscription
    //
    repl.AddSubscription(AddOption.CreateDatabase);

    // Synchronize to the SQL Server database
    //
    repl.Synchronize();
}
catch (SqlCeException)
{
    // Handle errors here
    //
}
finally
{
    // Dispose the repl object
    //
    repl.Dispose();
}

スレッド セーフ

この型の public static (Visual Basic では Shared ) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。

プラットフォーム

開発プラットフォーム

Windows Vista、Windows Mobile 5.0、Windows XP Professional with Service Pack 2 (SP2)、Windows Server 2003、Windows Mobile 2003 for Pocket PC、Windows CE 5.0
バージョン情報
.NET Framework および .NET Compact Framework
3.5 でサポート
.NET Framework
3.0 でサポート
.NET Compact Framework および .Net Framework
2.0 でサポート

参照

リファレンス

SqlCeReplication Class
SqlCeReplication Members
System.Data.SqlServerCe Namespace