Know the name of modified columns in the ResultStore
Samuel
Posts: 2
Hi,
I have successfully created with your sample a merge algorithm for two of my databases. The problem is that when I call resultsReader.GetRow(syncRecordObject.Bookmark).Values, I can see the list of all values that have changed but I can't understand how I can see to what column theses values is associated.
Here is a sample of my code:
Private Function SyncRecord(ByVal syncRecordObject As SynchronizationRecord) As Boolean
Dim resultsReader As Reader
Dim result As Boolean
If syncRecordObject.ResultsStoreType = Row.RowType.Different Then
resultsReader = _tableDifferences(syncRecordObject.TableName()).ResultsStore.GetReader(Row.RowType.All)
SyncRecord = False
If (syncRecordObject.TableName <> String.Empty) Then
Dim myRow As Row = resultsReader.GetRow(syncRecordObject.Bookmark)
Here, I want to know to which columns the values in myRow.Values is associated;
result = True
End If
Else
result = True
End If
Return result
End Function
Thank you very much.
P.S. Sorry for the poor formatting but the very small textbox for enter the texte is not very helpful.
I have successfully created with your sample a merge algorithm for two of my databases. The problem is that when I call resultsReader.GetRow(syncRecordObject.Bookmark).Values, I can see the list of all values that have changed but I can't understand how I can see to what column theses values is associated.
Here is a sample of my code:
Private Function SyncRecord(ByVal syncRecordObject As SynchronizationRecord) As Boolean
Dim resultsReader As Reader
Dim result As Boolean
If syncRecordObject.ResultsStoreType = Row.RowType.Different Then
resultsReader = _tableDifferences(syncRecordObject.TableName()).ResultsStore.GetReader(Row.RowType.All)
SyncRecord = False
If (syncRecordObject.TableName <> String.Empty) Then
Dim myRow As Row = resultsReader.GetRow(syncRecordObject.Bookmark)
Here, I want to know to which columns the values in myRow.Values is associated;
result = True
End If
Else
result = True
End If
Return result
End Function
Thank you very much.
P.S. Sorry for the poor formatting but the very small textbox for enter the texte is not very helpful.
Comments
I could not find any function in the SQL Data Compare SDK that will resolve a Row column to a column name in the ResultsReader, so I wrote my own. The GetFieldMatrix function will return a dictionary keyed on the row's column ordinal and valued on the column name.
This works for me, so I hope it's useful to you.