locked
How to change the ConnectionString of the remote database at Runtime RRS feed

  • Question

  • I'm using the "Walkthrough:Creating an Occasionally Connected Application" and I would like to be able to change the remote database server/instance name for the remote connection during runtime.

    I can see the connection string in a couple of settings type files, but changing those via an editor does not re-direct the application to a new remote database.

    Any guidance would be appreciated.

    TIA

    Fritz

    Fritz Switzer
    • Moved by Max Wang_1983 Thursday, April 21, 2011 10:41 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Saturday, November 7, 2009 6:49 PM

Answers

  • Hi Fritz,

    As per my understanding, you want to dynamically update the app to sync with  new remote server/instance. You change the connection settings to new remote database in the config files and app still syncs to old server/ database connection. (assuming no errors)

    You would need to restart your app to pick up your new remote server settings.  Other option would be to modify app to reload config settings.

    Also ensure that you can successfully connect to this new remote database directly through management studio.

    Thanks
    Jandeep
    jandeepc
    Tuesday, November 10, 2009 1:24 AM