SqlCeReplication PublisherSecurityMode

| No Comments

I've been toying around with SQL Server CE replication. For whatever reason, my code was failing with the following exception when I called Synchronize():

Failure to connect to sql server with provided connection information. sql server does not exist, access is denied because the iis user is not a valid user on the sql server, or the password is incorrect.

As it turns out, if you use the follow form of the SqlCeReplication ctor (as observed using Reflector):

public SqlCeReplication(string internetUrl, string internetLogin, string internetPassword, string publisher, string publisherDatabase, string publication, string subscriber, string subscriberConnectionString)

the PublisherSecurityMode is set to SecurityType.NTAuthentication. Otherwise, if you use the parameterless ctor, PublisherSecurityMode is left to its default, which is SecurityType.DBAuthentication. This assignment is NOT documented.

Leave a comment

Bookmark and Share

About this Entry

This page contains a single entry by DrFooMod2 published on December 15, 2009 10:58 AM.

Upgraded MT was the previous entry in this blog.

Import PDF into Visio 2007 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.