ADO.NET Sync Partial Table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to use the ADO.NET 2008 Sync Framework to sync only a portion
of a table?

Syncing the entire table is not an option for the app I am working on due to
the sheer size of the table, so I was wanting to apply business requirements
to the sync logic.

If it is possible, can somebody point me to an example somewhere?
 
J:
If you look at the SyncServices_CSharp_DownloadOnly app and specifically,
the Constructor for the SampleServerSyncProvider - just replace the code in
the middle where you actually delcare the SqlSyncAdapterBuilder to the code
below:

Basically, you add a FilterClause (and if it's parameterized, you can add a
SqlParameter - I was a bum and used concatenated sql which I should be
flogged for, but I wanted to whip something up quick this evening before I
signed off. To get the sample code to do the whole thing with a 'real'
param, there's a demo here
ms-help://MS.SynchronizationServices.v1.EN/syncdata1/html/15abacc8-a243-4570-86e9-da95bb5bfddd.htm
on BOL for Syn Services




//Instantiate a synchronization adapter builder, which

//queries the tables to be synchronized and builds the

//synchronization adapter and commands required to

//perform synchronization.

SqlSyncAdapterBuilder builder = new
SqlSyncAdapterBuilder((SqlConnection)this.Connection);

//Add the Customer table and its tombstone table, and

String filterCommand = "CustomerName='Sharp Bikes'";

//specify synchronization direction.

builder.TableName = "Sales.Customer";

builder.TombstoneTableName = builder.TableName + "_Tombstone";

builder.FilterClause = filterCommand ;

builder.TombstoneFilterClause = filterCommand;
 
Hello OuterStorm

Thanks for Willam's suggestion. Have you had chance to try it so far?
Because VS 2008 RTM hasn't been released so far. For such ADO.net Sync
Service issue, I suggest you may consider posting it in MSDN forum. To
special ADO.net Sync Service issue, the people in those groups will be more
likely to be able to help and familiar in such field.
http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=1225&SiteID=1

Hope this helps. If you have any more concern, please feel free to update
here again. We are glad to assist you.

Have a great day,
Best regards,

Wen Yuan
Microsoft Online Community Support
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top