Hi. I'm comparing a temporary table to an another table, to check for changes in the cells. The way I'm doing it, is that I'm using three loops; one to loop trough the temporary, one to loop trough the other table and a last one to loop trough each column. Here's the code:
vb.net Code:
For Each row As DataRowView In View For Each drow As DataRowView In view2 If row("emitid") = drow("emitid") Then For Each column As DataColumn In View.Table.Columns If Not row(column.ToString) = drow(column.ToString) Then row(column.ToString) = drow(column.ToString) End If Next Exit For End If Next Next
"emitid" is the column I use as a reference to be sure that I'm comparing the correct rows, and the column order will always be the same in both tables. Is this the best way of doing what I want? I feel it looks a bit complicated...![]()




Reply With Quote