Freigeben über


SqlCeReplication-Konstruktor

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

Überladungsliste

Initialisiert eine neue Instanz des SqlCeReplication-Objekts. Standardkonstruktor.

Wird nur von .NET Compact Framework unterstützt.

[Visual Basic] Public Sub New()

[C#] public SqlCeReplication();

[C++] public: SqlCeReplication();

[JScript] public function SqlCeReplication();

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

Wird nur von .NET Compact Framework unterstützt.

[Visual Basic] Public Sub New(String, String, String, String, String, String, String, String)

[C#] public SqlCeReplication(string, string, string, string, string, string, string, string);

[C++] public: SqlCeReplication(String*, String*, String*, String*, String*, String*, String*, String*);

[JScript] public function SqlCeReplication(String, String, String, String, String, String, String, String);

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.

Wird nur von .NET Compact Framework unterstützt.

[Visual Basic] Public Sub New(String, String, String, String, String, String, String, String, String, String)

[C#] public SqlCeReplication(string, string, string, string, string, string, string, string, string, string);

[C++] public: SqlCeReplication(String*, String*, String*, String*, String*, String*, String*, String*, String*, String*);

[JScript] public function SqlCeReplication(String, String, String, String, String, String, String, String, String, String);

Beispiel

[Visual Basic, C#] Hinweis   Dieses Beispiel veranschaulicht die Verwendung einer der überladenen Versionen des SqlCeReplication-Konstruktors. Weitere Beispiele finden Sie ggf. unter den einzelnen Themen zur Überladung.

 
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.

Siehe auch

SqlCeReplication-Klasse | SqlCeReplication-Member | System.Data.SqlServerCe-Namespace