Monday, March 12, 2012

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

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!!
AndreasHi Andreas,
I don't think that there is a built-in way.
Do it manually in a loop, perhaps.
--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com
"Andreas Klemt" <aklemt68@.hotmail.com> wrote in message
news:ufJReiBuDHA.540@.tk2msftngp13.phx.gbl...
> 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 Klemt wrote:
> 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.

Labels: , , , , , , , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home