468,780 Members | 2,347 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,780 developers. It's quick & easy.

filter datatable using indices

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

Jan 26 '06 #1
1 1184
Sam
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)

Jan 26 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Wiebke Pätzold | last post: by
2 posts views Thread by Paul | last post: by
1 post views Thread by CARIGAR | last post: by
2 posts views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.