none
Sync Framework 2.1 Filter 'IN' Clause RRS feed

  • Question

  • Hi,

       Is it possible to use an 'IN' clause or a join in an Sync Framework 2.1 filter clause (using parameters)?

    Thanks

    Paul.


    Paul Wainwright

    Friday, November 7, 2014 5:23 PM

Answers

  • sorry, wasn't so clear. the sql ce sync provider doesnt support filtering either.

    worst case scenario, you can intercept the changes in the ChangesSelected event and manually filter there. 

    can you not have per scope sql ce db instead?

    • Marked as answer by pr_wainwright Thursday, November 20, 2014 8:12 AM
    Wednesday, November 19, 2014 7:26 AM
    Moderator

All replies

  • should be possible. the filter in Sync Fx is simply concatenated to the WHERE clause when selecting changes. for as long as the resulting query is valid, it should work.
    Tuesday, November 18, 2014 2:20 AM
    Moderator
  • JuneT,

             Thanks for the reply. Ideally I would like a query similar to the below but the 'IN' clause could be quite large. I don't know the limits of SQL Server CE 3.5

    SELECT

    * FROM Assets WHERE LocationSystemsID in('228D769C-4D80-4EB5-871C-1A922DE72EC7', 'A87FBF41-E891-4349-B248-273125B646C4')

    Regards

    Paul.


    Paul Wainwright

    Trying to create the above filter on SQL Server CE 3.5 & SqlCeSyncScopeProvisioning does not have SqlCeSyncScopeProvisioningType.Template like SqlSyncScopeProvisioning. Is there a way around this?

    Thanks

    Paul.

    Can SqlCeSyncProvider be used? scopeName (The name of the scope which defines the set of tables (with optional filters) to synchronize. Can this be used for CE to CE synchronization?

    Thanks

    Paul.

    • Edited by pr_wainwright Tuesday, November 18, 2014 3:37 PM Updated
    Tuesday, November 18, 2014 8:02 AM
  • afaik, the length of sql is not limited.

    yes, there's no template provisioning for SQL Ce, but you can define multiple scopes still.

    Wednesday, November 19, 2014 12:55 AM
    Moderator
  • JuneT,

             Thanks for the reply. Is it possible in Sql Ce to define scopes for a subset of data in a table? Multiple scopes will be fine if this is possible.

    Thanks

    Paul.


    Paul Wainwright

    Wednesday, November 19, 2014 7:16 AM
  • sorry, wasn't so clear. the sql ce sync provider doesnt support filtering either.

    worst case scenario, you can intercept the changes in the ChangesSelected event and manually filter there. 

    can you not have per scope sql ce db instead?

    • Marked as answer by pr_wainwright Thursday, November 20, 2014 8:12 AM
    Wednesday, November 19, 2014 7:26 AM
    Moderator
  • JuneT,

             Thanks for the reply. Not sure what you mean 'per scope sql ce db instead'? 

    Thanks

    Paul. 


    Paul Wainwright

    Wednesday, November 19, 2014 8:51 AM
  • i mean have a separate sql ce db for every filtered scope

    Thursday, November 20, 2014 2:03 AM
    Moderator
  • JuneT,

             Thanks for the reply. How do I filter a scope in a CE to CE sync? I thought this was not supported?

    Regards

    Paul.


    Paul Wainwright

    Thursday, November 20, 2014 7:24 AM
  • sorry, what i meant since you cannot filter, create a separate sql ce db for every filtered rows that you want.

    e.g.,

    sqlce db1 for filter value 1

    sqlce db2 for filter value 2

    Thursday, November 20, 2014 7:39 AM
    Moderator
  • JuneT,

             Thanks for the reply. I will go with the ChangesSelected event technique you suggested earlier.

    Thanks

    Paul.


    Paul Wainwright

    Thursday, November 20, 2014 8:12 AM