locked
Filter Rows Issue RRS feed

  • Question

  • Hello together,

    I am quite new to the MS sync FX and started coding a small PDA app synching data from a server. 'cause the amount of data synched could be very large, I decided to add a FilterClause to my sync provider, but somehow it does not work.

    I started using the sample from http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=sync&ReleaseId=1713 and adapted it a little bit.

    So in the GBABuilderServerSyncProvider I added the following line of code:

    builder.FilterClause =

    "JobID > 9";

    But somehow it does not work. Every time I sync my device, ALL data is synched back.

    I also tried it using the FilterParamters Collection as described on this site: http://msdn.microsoft.com/en-us/library/bb726003.aspx

    Does anybody know what I am doing wrong and why my filter does not work. According to the official MS article about filtering rows (the link above) it should be quite easy to do so.

    Help please.

    Thanks in advance and kind regards,
    Harald

    PS: if anybody needs more code, I'll post it

    • Moved by Hengzhe Li Friday, April 22, 2011 3:26 AM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Sunday, April 19, 2009 8:31 PM

Answers

  • hey,

    thanks for all your answers.

    I just found out what the problem was. (something else by the way :-) )

    the filterclause works perfectly fine, even in v2 cpt1.

    br
    harry
    Tuesday, April 21, 2009 5:36 PM

All replies

  • I think, if you're data is synchronized to the client, and then it's synchronized back to the server(duplicate data over there)

    You must consider to give every client an ID range... SQL replication uses ID ranges too.. 
    but for some reason it is not supported by this CTP version of the sync framework.

    You'll have to write it manualy.

    Kind Regards.
    Monday, April 20, 2009 4:25 PM
  • hey,

    thanks for the reply.

    but why do i have to give every client an id range?
    i just want to set a filterclause .....

    is there an other way to do so?

    br
    harry
    Monday, April 20, 2009 5:52 PM
  • You can filter in the event handlers ApplyingChanges (don't know the exact name)
    then you'll move the processing to you're application instaid of the SQL server.
    But you'll have more network traffic, because you select all changes from the database and afer that you start filtering.
    Consider if that is critical. For mobile workers it is.. Slow network connections..
    Tuesday, April 21, 2009 8:34 AM
  • hey,

    thanks for all your answers.

    I just found out what the problem was. (something else by the way :-) )

    the filterclause works perfectly fine, even in v2 cpt1.

    br
    harry
    Tuesday, April 21, 2009 5:36 PM