Results 1 to 4 of 4

Thread: How to create instance of dataview or datatable from datareader which contains data

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2004
    Location
    Bangalore
    Posts
    16

    How to create instance of dataview or datatable from datareader which contains data

    How to create instance of dataview or datatable from datareader which contains data
    <b>Regards,<br>
    Thulasiraman.R</b>

  2. #2
    Addicted Member dani2's Avatar
    Join Date
    Feb 2005
    Location
    Sibiu.ro
    Posts
    191

    Re: How to create instance of dataview or datatable from datareader which contains data

    good question
    Home is where your Head is

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: How to create instance of dataview or datatable from datareader which contains da

    You don't create a DataTable from a DataReader. A DataReader retrieves data from a data source. A DataTable stores data. If you want the data retrieved by a data reader to be stored in a data table then you have to create the data table yourself, apply the appropriate schema and then populate it. I've posted some code in the VB.NET CodeBank to populate a DataTable from a DataReader.

    http://www.vbforums.com/showthread.php?t=381224

    A DataView object doesn't exist in isolation. All DataViews are a view of the data in a DataTable, so it follows that you must have a DataTable first. Every DataTable is automatically associated with a DataView through its DefaultView property. If you need more than one view of the same table you can explicitly create more DataView objects.

  4. #4
    Addicted Member dani2's Avatar
    Join Date
    Feb 2005
    Location
    Sibiu.ro
    Posts
    191

    Re: How to create instance of dataview or datatable from datareader which contains data

    that's exactly what I was looking for!
    thank you
    Home is where your Head is

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width