Results 1 to 5 of 5

Thread: [RESOLVED] [02/03] 2 DataReader objects in succession

  1. #1

    Thread Starter
    Fanatic Member vishalmarya's Avatar
    Join Date
    Feb 2001
    Location
    New Delhi , INDIA
    Posts
    858

    Resolved [RESOLVED] [02/03] 2 DataReader objects in succession

    i require to connect 2 DataReader objects in succession to the same connection object .

    but its not allowing me to do so.

    error generated is :

    "There is already an open DataReader associated with this Connection which must be closed first"


    instead of using DataReader , if i use DataAdapter object , it works .

    what is the correct and efficient way to read through records ?
    Vishal Marya, MCP .net 3.5
    My Site
    http://www.vstoolsgallery.com/
    http://visualstudiogallery.msdn.micr...b-f87a909b9266





    Please indicate what version of vb you use.
    Please mark your thread resolved using the Thread Tools above.
    -----------------------------------------

  2. #2
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: [02/03] 2 DataReader objects in succession

    You cannot have two Datreaders open on the same connection. You either have to use two different connections or change to DataSets.
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  3. #3

    Thread Starter
    Fanatic Member vishalmarya's Avatar
    Join Date
    Feb 2001
    Location
    New Delhi , INDIA
    Posts
    858

    Re: [02/03] 2 DataReader objects in succession

    Quote Originally Posted by Shuja Ali
    You cannot have two Datreaders open on the same connection. You either have to use two different connections or change to DataSets.

    can dataset be ceated from Datreader object ?

    or DataAdapter is the only way

    Thanks.
    Vishal Marya, MCP .net 3.5
    My Site
    http://www.vstoolsgallery.com/
    http://visualstudiogallery.msdn.micr...b-f87a909b9266





    Please indicate what version of vb you use.
    Please mark your thread resolved using the Thread Tools above.
    -----------------------------------------

  4. #4
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: [02/03] 2 DataReader objects in succession

    DataAdapter is the only way to create the DataSet. You cannot create a DataSet from a DataReader.

    alhtough the above is not entirely correct, however the process of creating a DataSet from a datareader would be more cumbersome than using a DataAdapter.
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [RESOLVED] [02/03] 2 DataReader objects in succession

    More pointless than cumbersome.

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