Can you select which column to sync with Sync Framework

心已入冬 提交于 2020-01-23 04:11:38

问题


I notice that with MS Sync, going through the wizard to create the WCF service that will do the sync, you can only choose which table to sync.

Is it possible to only sync a few columns of the table and not the entire table? It will also create the local sdf file with the whole table structure. I only need a few columns of the table to be displayed in my mobile device.


回答1:


You can achieve this by writing code. You can use the DbSyncTableDescription

DbSyncTableDescription tableDescription = SqlSyncDescriptionBuilder.GetDescriptionForTable(tableName, Collection<Columns>, server Connection)

The second parameter is the collection of Column Names you want to include in Sync.

Hope that helps




回答2:


The Sync Framework is a customizable and extensible framework hence it can surly be done. But you probably have to write some code - I am not aware that the database synchronization provider included in the framework supports synchronizing only a subset of the columns.



来源:https://stackoverflow.com/questions/2837683/can-you-select-which-column-to-sync-with-sync-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!