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
 
M

Miha Markic

Hi Andreas,

I don't think that there is a built-in way.
Do it manually in a loop, perhaps.
 
G

General Protection Fault

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.

Why do you need it back to a DataTable? You can bind to the DataView
just as easily.
 

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

Top