Audit Trail for data updated or inserted


I would like to apply audit trail function to connectors.
I want to capture table name, table field, old value and new value whenever
data is updated or inserted to SQL Server tables.
How could I capture data updated/inserted from connectors?
Should I make use of e.DataAction.Data?

I am using .NETversion.

Looking Forward to your reply asap.
Thanks a lot!!

yes, you may try using BeforeProcessing event:... connector.BeforeProcessing += new EventHandler<DataActionProcessingEventArgs>(beforeProcessing); return connector; } void beforeProcessing(object sender, DataActionProcessingEventArgs e) { var id = e.DataAction.PrimaryKeyValue; var type = e.DataAction.ActionType; var newValues = e.DataAction.Data; ...


It works perfect for new Values in connectors.
But How can I get old Values as well?

Thanks and Regards.


Also, I only want to capture the field values really updated,
e.g. I updated field A and field C only but not field B.
So I have to record down really field A and field C changes only.

Could I achieve?


I think the only way is to manually retrieve item that’s being updated from the database and compare it’s fields with the new ones. All of this should be done on BeforeProcessing event, when the item is still unchanged