Code:Private Function Auto_Notes() As String 'Employer auto notes Dim drER As DataRow drER = Me.DsEmployer1.Tables("Employer").Rows(0) Dim i As Integer For i = 0 To drER.Table.Columns.Count - 1 If drER(i, DataRowVersion.Original).ToString <> drER(i, DataRowVersion.Default).ToString Then Auto_Notes += drER.Table.Columns(i).ColumnName & " changed from '" & drER(i, DataRowVersion.Original) & "' to '" & drER(i, DataRowVersion.Default) & "'. " End If
I did not write this code the guy before me did, but i know what he was trying to do and it half works. A bound combobox gives you difference options. if you change what's in the combobox and hit Save and runs this Auto Notes and looks at what was in the table Originally and then What its going to be.
But my output string looks like this:
"Business_Structure changed from 'C-Corp' to ''. "
It's giving me the original value but not what the new one is. Is this code wrong? or something else? It seems to work when it's used on a different table.
Any help would be appreciated. Thanks!




Reply With Quote