SqlCeReplication Constructor (String, String, String, String, String, String, String, String, String, String)
Note: This namespace, class, or member is supported only in version 1.1 of the .NET Framework.
Initializes a new instance of the SqlCeReplication object and configures replication for Basic or Integrated authentication to IIS and SQL Server Authentication to 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);
Parameters
- internetUrl
The URL used to connect to the SQL Server CE Server Agent. - internetLogin
The login name used when connecting to the SQL Server CE Server Agent. - internetPassword
The password used when connecting to the SQL Server CE Server Agent. - publisher
The name of the Publisher. - publisherDatabase
The name of the publication database. - publisherLogin
The login name used when connecting to the Publisher. - publisherPassword
The login password used when connecting to the Publisher. - publication
The publication name that has been enabled for anonymous merge subscriptions. - subscriber
The name of the Subscriber. - subscriberConnectionString
The OLE DB connection string for the SQL Server CE database on the Windows CE .NET-based device.
Remarks
The following table shows initial property values for an instance of SqlCeReplication:
Property | Initial Value |
---|---|
ExchangeType | bi-directional |
LoginTimeout | 15 |
PublisherNetwork | defaultNetwork |
PublisherSecurityMode | NTAuthentication |
QueryTimeout | 30 |
Validate | NoValidation |
Example
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.
Requirements
Platforms: .NET Compact Framework
.NET Framework Security:
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries From Partially Trusted Code
See Also
SqlCeReplication Class | SqlCeReplication Members | System.Data.SqlServerCe Namespace | SqlCeReplication Constructor Overload List