Here is the C# code to create a SQL Server Compact Edition (formerly known as
SQL Server Everywhere and SQL Server Mobile) programmatically with hostname
filtering:
SqlCeReplication repl;
try
{
// Instantiate and configure SqlCeReplication object.
//
repl = new SqlCeReplication();
repl.InternetUrl = "http://www.websyncurl.com/sqlcesa30.dll";
repl.InternetLogin = internetLogin;
repl.InternetPassword = internetPassword;
repl.Publisher = publisher;
repl.PublisherSecurityMode = SecurityType.NTAuthentication;
repl.PublisherDatabase = publisherDatabase;
repl.Publication = publication;
repl.Subscriber = subscriber;
repl.SubscriberConnectionString = "Data Source=MyDatabase.sdf";
repl.HostName = hostname;
// Create a local SQL Server Compact database and subscription.
//
repl.AddSubscription(AddOption.CreateDatabase);
// Initialize the subscription.
//
repl.Synchronize();
}
catch (SqlCeException)
{
// Handle errors here
//
}
For more info, see these topics :
http://msdn2.microsoft.com/en-us/library/ms171908.aspx
http://msdn2.microsoft.com/en-us/library/ms365205.aspx

Signature
Glenn Gailey [MS]
SQL Server User Education
This posting is provided "AS IS" with no warranties, and confers no rights.
> Things I got to work
> SQL2K, Merge Publication -> SQL Everywhere (I used the interface in SQL2K5
[quoted text clipped - 7 lines]
>
> Also can I do this programmatically?