views:

140

answers:

1

Hallo,

I have a dataset with a datatable which is frequently transmitted via WCF (with NetMsmqBinding) to a service in order to store the changes in the database.

In order to keep the message size small I would like to transmit only the changed records to the service (DataRow.RowState != Unchanged). I have tried to use the IDataContractSurrogate in order to skip the unchanged rows during the serialization process, but the method GetObjectToSerialize is only called for the DataSet itself and not for any DataRow.

Is there a way to skip unchanged rows of a datatable during the serialization process using the datacontractserializer?

Thanks in advance, Jeldrik

+2  A: 

There's a GetChanges method.

John Saunders
Thanks, seems like I was heading in the complete wrong direction, without looking at the obvious.