For Each dr As DataRow In CurrentTable.DataTable.DataRows If dr.RowState = DataRowState.Modified Then dr.BaseRow("System_Filter_Unique") = 1 ElseIf dr.RowState = DataRowState.Added Then dr.BaseRow("System_Filter_Unique") = 1 End If Next CurrentTable.Filter = "System_Filter_Unique = 1"