Harry,
As Anushi wrote there is no standard distinct in Net 1.0 or 1.1
There is a sample in a page on MSDN, I find this sample I once made more
easy (and it is more complete)
\\\
Me.DataGrid1.DataSource = distinct(dt, "MyDistinctElement")
End Sub
Public Function distinct(ByVal dt As DataTable, _
ByVal dist As String) As DataTable
Dim dtclone As DataTable = dt.Clone
Dim dv As New DataView(dt)
dv.Sort = dist
Dim myselold As String = ""
For i As Integer = 0 To dv.Count - 1
If myselold <> dv(i)(dist).ToString Then
Dim drn As DataRow = dtclone.NewRow
For y As Integer = 0 To drn.ItemArray.Length - 1
drn(y) = dv(i)(y)
Next
myselold = dv(i)(dist).ToString
dtclone.Rows.Add(drn)
End If
Next
Return dtclone
End Function
///
I hope this helps?
Cor
Can the DataTable.Select Method use 'Distinct' to remove duplicate rows?
If so how? I tried, however code triggered error 'no colmn 'Distinct' found'.
Thanks
Harry