How to convert a DataView with RowFilter to a new DataTable?

A

Andreas Klemt

Hello,
I have this:

Dim dv As New DataView(GetUsersAsDataTable())
dv.RowFilter = "brithday >= 1970"

Dim dt As New DataTable
dt = **how to bring my rowfiltered DataView to a new DataTable** ?

When I do
dt = dv.Table
I get my original DataTable so that is unfortunatly not the solution.

Thanks for any help in advance!!
Andreas
 
C

Craig Deelsnyder

Andreas said:
Hello,
I have this:

Dim dv As New DataView(GetUsersAsDataTable())
dv.RowFilter = "brithday >= 1970"

Dim dt As New DataTable
dt = **how to bring my rowfiltered DataView to a new DataTable** ?

When I do
dt = dv.Table
I get my original DataTable so that is unfortunatly not the solution.

Thanks for any help in advance!!
Andreas

Unfortunately you have to manually do this. Loop through the DataView's
items and copy them (import) to a new DataTable.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top