locked
Problem with Sync Framework, SQL CE and XML Column RRS feed

  • Question

  • Hi folks,

    I just started learning the MS Sync Framework with the SyncServices_CSharp_DevicesSample (GBASyncServicesForDevices.sln)

    This example runs fine and now I want to sync my own tables.

    But here I am running into troubles because some of my tables contain a XML Column.
    So it is not possible to use the Local Data Cache Designer for configuring, because
    the designer does not show these tables, because they are not compatible with SQL CE.

    So I guess the solution with be try write a parser at the sync process to transfer
    XML to NTEXT and NTEXT back to XML

    Is this right? How can I do this? Does maybe anybody have an example project?

    And is there a way to use the Local Data Cache Designer to create the files?


    Or do I have to change something in the MS Synch Framework configuration?
    Or do you suggest another framework?


    My basic application should run on Windows Mobile 2005 (maybe also 2003) and sync
    6-12 Tables which also contain XML-Columns.
    It´s not possible to have a permantent WAN-Connection so I have to use a local data store.

    That´s why I thought about SQL CE and the sync framework. Another solution I have in mind
    is to design a mobile website instead of a Windows App and use Google Gears instead.

    What do you think?



    Regards,

    Martin
    • Moved by Tina_Tian Friday, April 22, 2011 6:00 AM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Monday, January 19, 2009 12:52 PM

Answers

  • I believe by default SqlCE is going to map your server XML columns to nText. Once you have your "xml" data locally in CE you are going to have to do XML parsing in your managed code if you want to use it as xml, otherwise its just string data.

    And FWIW, I think you are right, when I was just getting started and using the designer I don't remember it liking the XML type. If you do the syncing in code though, you can pull down the data just fine (it just comes down as nText).
    Thursday, January 22, 2009 4:39 PM
  • Correct. the sync service suppports mapping xml datat type from SQLServer to ntext data type on the SQLCE client. there is a limitation in the sync designer so such tables are not shown.

     

    you can work around this limitation by writing your own sync code.

     

    thanks

    Yunwen

    Monday, January 26, 2009 4:57 AM
    Moderator

All replies

  • I believe by default SqlCE is going to map your server XML columns to nText. Once you have your "xml" data locally in CE you are going to have to do XML parsing in your managed code if you want to use it as xml, otherwise its just string data.

    And FWIW, I think you are right, when I was just getting started and using the designer I don't remember it liking the XML type. If you do the syncing in code though, you can pull down the data just fine (it just comes down as nText).
    Thursday, January 22, 2009 4:39 PM
  • Correct. the sync service suppports mapping xml datat type from SQLServer to ntext data type on the SQLCE client. there is a limitation in the sync designer so such tables are not shown.

     

    you can work around this limitation by writing your own sync code.

     

    thanks

    Yunwen

    Monday, January 26, 2009 4:57 AM
    Moderator
  • Thank you very much!
    Monday, January 26, 2009 8:17 AM