locked
Multiple connections in DbServerSyncProvider RRS feed

  • Question

  • Hi,

     

    I want to retrieve data to a mobile device from one database and upload data to another database.

    I have this working fine with separate tables in the same database using a single class inheriting from DbServerSyncProvider. I used the connection member of the DbServerSyncProvider class to specify the connection.

     

    I have now tried to have the tables in different databases and specify the connection using the connection member in the database command for SelectIncrementalInsertsCommand and UpdateCommand on the SyncAdapter.

     

    This does not seem to work. Is the DbServerSyncProvider limited to connecting to one server database?

     

    Thanks for any input!

     

    Mats

    • Moved by Max Wang_1983 Thursday, April 21, 2011 6:02 PM forum consolidation (From:SyncFx - Technical Discussion [ReadOnly])
    Wednesday, November 12, 2008 2:44 PM

Answers

  • Hi MatsX,

     

    using two IIS web services is a soluton for this issue. alternatively, you can think to control your web session by yourself and getting different dbprovider instances based on your session's need. something like:

     

    begin yourwebsession

    do sync

    end you sync session

     

     

    thanks

    Yunwen

    Thursday, November 20, 2008 2:35 AM
    Moderator

All replies

  • Hi again,

     

    I solved the problem by setting up two different web services, each one implementing a DbServerSyncProvider connected to one source.

    I download a complete selection every time, based on parameters set up on the client. This means there is no need to keep track of updates on the server side, which could be a problem when working with more than one server database.

     

    I still think this is an interestiong topic and would like your feedback on what is the best solution.

     

    Thanks,

     

    Mats

    Friday, November 14, 2008 8:40 AM
  • Hi MatsX,

     

    using two IIS web services is a soluton for this issue. alternatively, you can think to control your web session by yourself and getting different dbprovider instances based on your session's need. something like:

     

    begin yourwebsession

    do sync

    end you sync session

     

     

    thanks

    Yunwen

    Thursday, November 20, 2008 2:35 AM
    Moderator