locked
SQL Merge Replication - Replication via button click within Desktop Application RRS feed

  • Question

  • I'm looking for help in merging a SQL CE database from a WM 5.0 device with SQL Server 2005.  I have seen several ways of setting this up via IIS and using a mobile side application to initialize merge replication.  However I'm looking for a way to either fire the merge replication via a button click within a desktop application or when the device is connected via ActiveSync.  All the code is written in C#. 

     

    I've written applications to use merge replication with SQL Express and SQL Server, however I'm not a expert by any means when it comes to Merge Replication.

     

    Any help or guidance would be greatly appreciated.

    Monday, December 17, 2007 8:19 PM

Answers

  • Hi Benjamin,

     

     Benjamin00 wrote:
    I have seen several ways of setting this up via IIS and using a mobile side application to initialize merge replication.  However I'm looking for a way to either fire the merge replication via a button click within a desktop application or when the device is connected via ActiveSync.  All the code is written in C#

     

    Due to the way merge Replication works it goes via IIS and is initiated by the client (i.e. the device).

     

    What you could do if you wanted the desktop to appear to initiate this sequence is one of the following options:

    • Use the State and Notification Broker within your device application to detect when the ActiveSync connection is established. When the Changed event fires you could start off the replication process.
    • Use RAPI (and a wrapper library such as OpenNETCF's free Desktop Communication library) to get your desktop application to programmatically start an executable on the connected PDA to start the replication process.

     

    Hope this helps,

    Christopher Fairbairn

    Tuesday, December 18, 2007 12:34 AM

All replies

  • Hi Benjamin,

     

     Benjamin00 wrote:
    I have seen several ways of setting this up via IIS and using a mobile side application to initialize merge replication.  However I'm looking for a way to either fire the merge replication via a button click within a desktop application or when the device is connected via ActiveSync.  All the code is written in C#

     

    Due to the way merge Replication works it goes via IIS and is initiated by the client (i.e. the device).

     

    What you could do if you wanted the desktop to appear to initiate this sequence is one of the following options:

    • Use the State and Notification Broker within your device application to detect when the ActiveSync connection is established. When the Changed event fires you could start off the replication process.
    • Use RAPI (and a wrapper library such as OpenNETCF's free Desktop Communication library) to get your desktop application to programmatically start an executable on the connected PDA to start the replication process.

     

    Hope this helps,

    Christopher Fairbairn

    Tuesday, December 18, 2007 12:34 AM
  •  Christopher Fairbairn wrote:

    Hi Benjamin,

     

     Benjamin00 wrote:
    I have seen several ways of setting this up via IIS and using a mobile side application to initialize merge replication.  However I'm looking for a way to either fire the merge replication via a button click within a desktop application or when the device is connected via ActiveSync.  All the code is written in C#

     

    Due to the way merge Replication works it goes via IIS and is initiated by the client (i.e. the device).

     

    What you could do if you wanted the desktop to appear to initiate this sequence is one of the following options:

    • Use the State and Notification Broker within your device application to detect when the ActiveSync connection is established. When the Changed event fires you could start off the replication process.
    • Use RAPI (and a wrapper library such as OpenNETCF's free Desktop Communication library) to get your desktop application to programmatically start an executable on the connected PDA to start the replication process.

     

    Hope this helps,

    Christopher Fairbairn

     

    Thank you for the help.  I was considering using RAPI to start the application client side to initialize merge replication.  I was wondering if there was another way that I may be overlooking.   Working with mobile sometimes seems you go through a maze to be able to accomplish something that you would think would be more streamlined.  Using the State and Notification Broker seems more indepth then I need to take it.  Once again thank you for your reply it was quite helpful.

    Tuesday, December 18, 2007 2:14 PM
  • hello Christopher ,
               I need to do a sql merger replication between windows mobile 6 and MSSQL 2005 express edition. Is it possible for the express edition or do i need other sql for replication

    Legend
    Wednesday, December 24, 2008 5:35 AM
  • Hi Lakpa,

    For SQL merge replication, first you need publish the database from SQL Server. SQL server 2005 express edition do not support publishing the database from you server. So for this you need to install SQL Server 2005 enterprise edition.

    Regards,
    Malleswar
    • Proposed as answer by Lakpa Wednesday, December 31, 2008 11:28 AM
    Wednesday, December 24, 2008 8:33 AM
  • Malleswar said:

     So for this you need to install SQL Server 2005 enterprise edition.

    Regards,
    Malleswar

    You can also use SQL Server 2005 Standard.  Express will work in Workgroup mode as long as you have a publisher (SQL Standard or Enterprise).
    Saturday, December 27, 2008 9:26 PM