Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 610509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:41:00+00:00 2026-05-13T17:41:00+00:00

I have a SQL Server 2005 box set up for merge replication to SQL

  • 0

I have a SQL Server 2005 box set up for merge replication to SQL Server CE 3.0. The publication, publisher, distributor and IIS have all been set up.

In my application, I attempt to sync the databases using the following code:

//TODO: Change for production
//***************************
string localDBPath = @"C:\Documents and Settings\Robert\Desktop\MyDB.sdf";
//***************************

SqlCeReplication replicator = new SqlCeReplication();
replicator.InternetUrl = "http://myWebServer/sqlcesa30.dll";
replicator.Publisher = "mySqlServer";
replicator.PublisherDatabase = "myDatabase";
replicator.PublisherSecurityMode = SecurityType.NTAuthentication;
replicator.Publication = "myPublication";
replicator.Subscriber = Dns.GetHostName();
replicator.SubscriberConnectionString = @"Data Source=" + localDBPath;

try
{
    // Check if the database file already exists
    if (!System.IO.File.Exists(localDBPath))
    {
        // Add a new subscription and create the local database file
        replicator.AddSubscription(AddOption.CreateDatabase);
    }

    // Transfer the initial snapshot of data if this is the first time this is called.
    // Subsequent calls will transfer only the changes to the data.
    replicator.Synchronize();
}
catch (SqlCeException ex)
{
    // Display any errors in message box
    MessageBox.Show(ex.Message);
}
finally
{
    // Dispose of the SqlCeReplication object, but don't drop the subscription
    replicator.Dispose();
}

Unfortunately, this code fails at the “replicator.Synchronize” line with the following error message:

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.

This error message is not very clear to me and I am running out of places to look for the cause of this. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T17:41:00+00:00Added an answer on May 13, 2026 at 5:41 pm

    Make sure the agent account is the same user and password on all boxes.

    Make sure you are calling the right instances.

    Make sure agent is started on all machines involved.

    Check the sql event logs on all servers and see which is giving the error, this may also narrow the issue down.

    You can also check this to make sure you have setup correctly:

    http://msdn.microsoft.com/en-us/library/aa454892.aspx

    Same issue here he had to add the instance name correctly:

    http://bytes.com/topic/sql-server/answers/611761-merge-replication-error-failure-connect-sql-server-provided-connection

    Check these out too:

    http://support.microsoft.com/kb/314783

    http://support.microsoft.com/kb/319723

    http://msdn2.microsoft.com/en-us/library/ms172357.aspx

    again make sure you instances are correct:
    repl.Publisher = “macnine-name\instance-name”

    You can also take a look through this blog:

    http://blogs.msdn.com/sql_protocols/archive/2005/09/28/474698.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have installed SQL Server 2005 three times now on the same box. I
I have sql 2000 server and sql 2005 server running on the same box
I have the SQL Server 2005 Developer Edition DVD. I have been trying to
I have a SQL Server 2005 database that has been deleted, and I need
I have been running SQL Server 2005 Express Management Studio (SSMSE), and I now
We have a .NET e-commerce application with a SQL Server 2005 back-end. A new
I have SQL Server 2005 and all dates are stored using a DATETIME column
I have SQL Server 2005 and I am looking for a way to take
SSMS 2008 doesn't have SQL Intellisense when connected to SQL Server 2005! I know
SQL Server 2005 I have an SQL Function (ftn_GetExampleTable) which returns a table with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.