locked
Possible to create SqlSyncAdapterBuilder.FilterClause in SyncAdapter? RRS feed

  • Question

  • Hi, I've been using the auto-generated .sync file (created via the sync wizard) and overriding the OnInitialized event to replace some of the auto-generated settings for the SyncAdapters in the DbServerSyncProvider.

    All of the adapters in the auto-generated code inherit from SyncAdapter and set their properties (and don't use the SyncAdapterBuilder), but I've noticed that SyncAdapter seems to have no FilterClause property, but the SyncAdapterBuilder enables you to set it? I don't fully understand the object model, but was kind of expecting the same properties to be exposed in the SyncAdapter as in the SyncAdapterBulder. I'm not sure how I can set the FilterClause in the SyncAdapter without using the builder? (I need to partition the data to increase performance and can't do this without using the FilterClause)

    Is there an easy way to move away from the the auto-generated code to using my own DbServerSyncProvider (without losing anything). I've been putting this off as it looks a big task?
    • Edited by SunHunter Friday, July 10, 2009 9:37 AM
    • Moved by Max Wang_1983 Thursday, April 21, 2011 12:35 AM forum consolidation (From:SyncFx - Technical Discussion [ReadOnly])
    Friday, July 10, 2009 9:21 AM

Answers

  • I've just worked out a slow way of doing it based on this MSDN article: http://msdn.microsoft.com/en-us/library/bb726003.aspx (means editing each select query and adding new parameters for each and it would be a lot quicker to do this using the SyncAdapterBuilder.

    I would still like to know if there is an easy way of converting the designer-generated DbServerSyncProvider to use SyncAdapterBulder? (i guess another question is why it doesn't use the builder by default...)
    • Marked as answer by SunHunter Friday, July 10, 2009 8:59 PM
    Friday, July 10, 2009 10:38 AM

All replies

  • I've just worked out a slow way of doing it based on this MSDN article: http://msdn.microsoft.com/en-us/library/bb726003.aspx (means editing each select query and adding new parameters for each and it would be a lot quicker to do this using the SyncAdapterBuilder.

    I would still like to know if there is an easy way of converting the designer-generated DbServerSyncProvider to use SyncAdapterBulder? (i guess another question is why it doesn't use the builder by default...)
    • Marked as answer by SunHunter Friday, July 10, 2009 8:59 PM
    Friday, July 10, 2009 10:38 AM
  • I have the same question -- anyone have an answer? 

    The quickest hack I could think of is to modify the designer.cs and put your clause in there, which is horrible, terrible hack that no one should ever do.  Surely there's a way to do this without me writing thousands of lines of code to create all the syncs, etc.  I have like 20 tables, I really would prefer not to have to do this...  Anyone???



    travich
    • Edited by travich Thursday, September 17, 2009 8:24 PM Clarifying my question...
    Thursday, September 17, 2009 8:06 PM
  • ANYONE??? 

    Travich
    Monday, September 28, 2009 4:46 PM