Freigeben über


SqlCeReplication-Konstruktor (String, String, String, String, String, String, String, String, String, String)

Hinweis: Dieser Namespace oder Member bzw. diese Klasse wird nur von .NET Framework, Version 1.1, unterstützt.

Initialisiert eine neue Instanz des SqlCeReplication-Objekts und konfiguriert für Standardauthentifizierung oder integrierte Authentifizierung Replikation in IIS und für SQL Server-Authentifizierung Replikation in SQL Server.

Public Sub New( _
   ByVal internetUrl As String, _   ByVal internetLogin As String, _   ByVal internetPassword As String, _   ByVal publisher As String, _   ByVal publisherDatabase As String, _   ByVal publisherLogin As String, _   ByVal publisherPassword As String, _   ByVal publication As String, _   ByVal subscriber As String, _   ByVal subscriberConnectionString As String _)
[C#]
public SqlCeReplication(
   stringinternetUrl,stringinternetLogin,stringinternetPassword,stringpublisher,stringpublisherDatabase,stringpublisherLogin,stringpublisherPassword,stringpublication,stringsubscriber,stringsubscriberConnectionString);
[C++]
public: SqlCeReplication(
   String* internetUrl,String* internetLogin,String* internetPassword,String* publisher,String* publisherDatabase,String* publisherLogin,String* publisherPassword,String* publication,String* subscriber,String* subscriberConnectionString);
[JScript]
public function SqlCeReplication(
   internetUrl : String,internetLogin : String,internetPassword : String,publisher : String,publisherDatabase : String,publisherLogin : String,publisherPassword : String,publication : String,subscriber : String,subscriberConnectionString : String);

Parameter

  • internetUrl
    Der URL für die Herstellung einer Verbindung mit dem SQL Server CE Server Agent.
  • internetLogin
    Der beim Herstellen einer Verbindung mit dem SQL Server CE Server Agent verwendete Anmeldename.
  • internetPassword
    Das beim Herstellen einer Verbindung mit dem SQL Server CE Server Agent verwendete Kennwort.
  • publisher
    Der Name des Publishers.
  • publisherDatabase
    Der Name der Veröffentlichungsdatenbank.
  • publisherLogin
    Der beim Herstellen einer Verbindung mit dem Publisher verwendete Anmeldename.
  • publisherPassword
    Das beim Herstellen einer Verbindung mit dem Publisher verwendete Anmeldekennwort.
  • publication
    Der für anonyme Zusammenführungsabonnements aktivierte Veröffentlichungsname.
  • subscriber
    Der Name des Abonnenten.
  • subscriberConnectionString
    Die OLE DB-Verbindungszeichenfolge für die SQL Server CE-Datenbank auf dem Windows CE .NET-Gerät.

Hinweise

In der folgenden Tabelle werden die anfänglichen Eigenschaftenwerte für eine Instanz von SqlCeReplication aufgeführt:

Eigenschaft Anfangswert
ExchangeType bidirektional
LoginTimeout 15
PublisherNetwork defaultNetwork
PublisherSecurityMode NTAuthentication
QueryTimeout 30
Validate NoValidation

Beispiel

 
Dim repl As SqlCeReplication = Nothing

Try
   ' Set the Replication object
   repl = New SqlCeReplication()
   repl.InternetUrl       = "<http://www.northwindtraders.com/sqlce/sscesa20.dll>"
   repl.InternetLogin     = "MyLogin"
   repl.InternetPassword  = "<password>"
   repl.Publisher         = "MyPublisher"
   repl.PublisherDatabase = "MyPublisher Database"
   repl.PublisherLogin    = "MyPublisher Login"
   repl.PublisherPassword = "<password>"
   repl.Publication       = "MyPublication"
   repl.Subscriber        = "MySub"
   repl.SubscriberConnectionString = "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data Source=\ssce.sdf"
   
   ' Create the Local SSCE Database subscription
   repl.AddSubscription(AddOption.CreateDatabase)
   
   ' Synchronize to the SQL Server 2000 to populate the Subscription 
   repl.Synchronize()

Catch e As SqlCeException
' Use your own error handling routine to show error information.
' ShowError.ShowErrors(e);

Finally
   ' Dispose of the Replication Object
   repl.Dispose()
End Try

[C#] 

        SqlCeReplication repl = null;

        try {
            // Set the Replication object
            repl = new SqlCeReplication();
            repl.InternetUrl       = "<http://www.northwindtraders.com/sqlce/sscesa20.dll>";
            repl.InternetLogin     = "MyLogin";
            repl.InternetPassword  = "<password>";
            repl.Publisher         = "MyPublisher";
            repl.PublisherDatabase = "MyPublisher Database";
            repl.PublisherLogin    = "MyPublisher Login";
            repl.PublisherPassword = "<password>";
            repl.Publication       = "MyPublication";
            repl.Subscriber        = "MySub"; 
            repl.SubscriberConnectionString = "Provider=Microsoft.SQLSERVER.OLEDB.CE.2.0;Data Source=\\ssce.sdf";

            // Create the Local SSCE Database subscription
            repl.AddSubscription(AddOption.CreateDatabase);

            // Synchronize to the SQL Server 2000 to populate the Subscription 
            repl.Synchronize();
        }
   
        catch(SqlCeException) {
            // Use your own error handling routine to show error information.
        }

        finally {
            // Dispose of the Replication Object
            repl.Dispose();
        }

[C++, JScript] Für C++ oder JScript ist kein Beispiel verfügbar. Klicken Sie zum Anzeigen eines Beispiels für Visual Basic oder C# in der linken oberen Ecke der Seite auf die Schaltfläche "Sprachfilter" Sprachfilter.

Anforderungen

Plattformen: .NET Compact Framework - Windows CE .NET

.NET Framework-Sicherheit:

Siehe auch

SqlCeReplication-Klasse | SqlCeReplication-Member | System.Data.SqlServerCe-Namespace | SqlCeReplication-Konstruktorüberladungsliste