Mohsen
Mohsen

Reputation: 4266

Syncframework:Map single table into multiple tables

I have two tables like the fallowing:

On server:

      |  Orders Table                             | OrderDetails Table
-------------------------------------------------------------------------------------
      |     Id                                    |   Id
      |     OrderDate                             |   OrderId
      |     ServerName                            |   Product                     
                                                  |   Quantity          

On client:

        |  Orders Table                             |  OrderDetails Table
-------------------------------------------------------------------------------------
        |   Id                                      |      Id
        |   OrderDate                               |      OrderId
                                                    |      Product                     
                                                    |      Quantity       
                                                    |      ClientName

I need to sync the [Server].[Orders Table].[ServerName] to [Client].[OrderDetails Table].[ClientName]

The Question:

What is the true and efficient way of making it?

I know Deprovisioning and provisioning with different config, is one way of doing it.

So I just wanna know the correct way.

Thanks.

EDIT : Other columns of each table should sync normally ([Server].[Orders Table].[Id] to [Client].[Orders Table].[Id] ...).

And mapping strategy sometimes changes based on the row of data (which which is sending/receiving).

Upvotes: 0

Views: 105

Answers (1)

JuneT
JuneT

Reputation: 7860

Sync Fx is not an ETL tool. simply put, it's DB sync is per table.

if you really want to force it to do what you want, you can simply intercept ChangesSelected event for the OrderDetails table, lookup the extra column from the other table and then dynamically add the column to the dataset before it gets applied on the other side.

see this link on how to manipulate the change dataset

Upvotes: 1

Related Questions