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

Discussion in 'ASP .Net' started by Andreas Klemt, Dec 1, 2003.

  1. 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, Dec 1, 2003
    #1
    1. Advertising

  2. Andreas Klemt

    B Guest

    What are you trying to do?

    "Andreas Klemt" <> wrote in message
    news:...
    > 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
    >
    >
    B, Dec 1, 2003
    #2
    1. Advertising

  3. 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.
    >
    > 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.

    --
    Craig Deelsnyder
    Microsoft MVP - ASP/ASP.NET
    Craig Deelsnyder, Dec 1, 2003
    #3
  4. Andreas Klemt

    betocastillo86

    Joined:
    Nov 18, 2008
    Messages:
    1
    Convert

    DataView dv

    DataTable dt = dv.Table;
    betocastillo86, Nov 18, 2008
    #4
  5. Andreas Klemt

    nabeel

    Joined:
    Apr 19, 2012
    Messages:
    1
    try dv.ToTable() instead of dv.Table
    nabeel, Apr 19, 2012
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul Meller

    DataView.Rowfilter String Problem

    Paul Meller, Jan 15, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    695
    Paul Meller
    Jan 15, 2004
  2. Ryan Moore

    DataView RowFilter

    Ryan Moore, Jul 30, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    4,007
    Ryan Moore
    Jul 30, 2004
  3. =?Utf-8?B?Tm92aWNl?=

    DataView class's RowFilter property

    =?Utf-8?B?Tm92aWNl?=, Aug 16, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    505
  4. Jensen bredal

    DataView.RowFilter issue.

    Jensen bredal, Apr 5, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    4,776
    Jensen bredal
    Apr 5, 2005
  5. Isambella Yiota via DotNetMonster.com

    DataView with RowFilter (Result Error)

    Isambella Yiota via DotNetMonster.com, May 16, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    3,673
    =?Utf-8?B?RGF2aWQgVGFsYm90?=
    May 16, 2005
Loading...

Share This Page