maria

maria

  • NA
  • 1
  • 0

Eliminating duplicates from datagrid

Apr 25 2007 4:14 PM
I have the following code but for some reason it adds some fields multiple times.

For Each row As DataRow In objTable.Rows

myTable.Columns("API").Unique = True

'objTable.Columns("API").Unique = True

apiValue = CStr(row.Item("API"))

matchedRows = myTable.Select("API = '" & apiValue & "'")

If matchedRows.Length > 0 Then

If Not apiList.Contains(apiValue) Then

apiList.Add(apiValue)

'dgResults.DataSource = apiList

dgResults.Rows.Add(apiValue)

End If

End If

Next