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

  2. Andreas Klemt

    B Guest

    What are you trying to do?
     
    B, Dec 1, 2003
    #2
    1. Advertisements

  3. Unfortunately you have to manually do this. Loop through the DataView's
    items and copy them (import) to a new DataTable.
     
    Craig Deelsnyder, Dec 1, 2003
    #3
  4. Andreas Klemt

    betocastillo86

    Joined:
    Nov 18, 2008
    Messages:
    1
    Likes Received:
    0
    Convert

    DataView dv

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

    nabeel

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

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 (here). After that, you can post your question and our members will help you out.