Results 1 to 12 of 12

Thread: Using a DataReader to populate a dataset

Hybrid View

  1. #1
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: Using a DataReader to populate a dataset

    use the data reader to fill the data table... thusly:

    datatable.fill(yourDataReader)

    now do what you need to do with the datatable. You don't need to loop through the reader yourself.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  2. #2

    Thread Starter
    Fanatic Member The_Grudge's Avatar
    Join Date
    Jan 2005
    Location
    Canada
    Posts
    836

    Re: Using a DataReader to populate a dataset

    Quote Originally Posted by techgnome View Post
    use the data reader to fill the data table... thusly:

    datatable.fill(yourDataReader)

    now do what you need to do with the datatable. You don't need to loop through the reader yourself.

    -tg
    My purpose for looping through the datareader was so that I could check the fields in each record and modify them as needed (e.g. date formats, length). Are you suggesting I loop through the datatable instead?

    I tried your code - it says "fill is not a member of 'System.Data.DataTable".

    At this point I feel like I should mention I'm relatively new to VB.NET

    I appreciate your help.

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