filter datatable using indices

  • Thread starter Thread starter Sam
  • Start date Start date
S

Sam

Hi,

I have filtered a datatable using a dataview. Afterward, I get the
datarow indices of the datable of the rows that are contained by the
dataview:

Dim MyIndex As New ArrayList

For Each drv As DataRowView In myDataview
MyIndex.Add(myDatatable.Rows.IndexOf(drv.Row))
Next

I hope it's clear enough :-)
Now what I would like to do is to filter again the datatable using
another dataview, but this time the filter would be the indices
contained in myIndex. Is it possible ? If not, how can I do that ?

Thanks
 
arf... I've found out by myself :

dt2 = myDatatable.Clone
For Each index As Integer In MyIndex
dt2.ImportRow(myDatatable.Rows(index))
Next

Dim dv2 As DataView = New DataView(dt2)
 
Back
Top