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

  • Thread starter Thread starter Andreas Klemt
  • Start date Start date
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
 
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.
 
Back
Top