Initializes a new instance of the SqlCeReplication object. For more information on replication, see SQL Server Books Online. For more information on merge replication in SQL Server CE, see the SQL Server CE Books Online.
For a list of all members of this type, see SqlCeReplication Members.
System.Object
System.MarshalByRefObject
System.Data.SqlServerCe.SqlCeReplication
[Visual Basic] NotInheritable Public Class SqlCeReplication Inherits MarshalByRefObject Implements IDisposable [C#] public sealed class SqlCeReplication : MarshalByRefObject, IDisposable [C++] public __gc __sealed class SqlCeReplication : public MarshalByRefObject, IDisposable [JScript] public class SqlCeReplication extends MarshalByRefObject implements IDisposable
Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.
[Visual Basic] 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] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button
in the upper-left corner of the page.
Namespace: System.Data.SqlServerCe
Platforms: .NET Compact Framework - Windows CE .NET
Assembly: System.Data.Sqlserverce (in System.Data.Sqlserverce.dll)
SqlCeReplication Members | System.Data.SqlServerCe Namespace