Re: reading sqldatareader after conn.close()

Discussion in 'ASP .Net' started by Ante Perkovic, Jul 2, 2003.

  1. "Naveen K Kohli" <> wrote in message news:<>...
    > DataReader is not exactly but sort of a connected recordset. Meaning when it
    > starts reading from DB, it does not know records before hand. It reads them
    > one at a time and streams them to the caller. It does not keep any thing in
    > memory. Once you have read one record it forgets about it. And once you have
    > read all records. You can't go back. After closing the connection you can't
    > use the same data reader unless you open a new connection for it.


    Thanks.

    Can I do smt. like in code below?

    Function whatever (...) as sqldatareader
    ...
    mydatareader = blabla.executeReader
    conn.close()
    return mydatareader
    End function

    Ante
     
    Ante Perkovic, Jul 2, 2003
    #1
    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. Simon Harris

    Conn.Close & Conn.Dispose

    Simon Harris, May 31, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    5,974
    Karl Seguin
    Jun 1, 2005
  2. FC
    Replies:
    3
    Views:
    4,213
  3. elitehunter99
    Replies:
    0
    Views:
    442
    elitehunter99
    Oct 17, 2006
  4. JTL.zheng
    Replies:
    6
    Views:
    419
    JTL.zheng
    Nov 11, 2007
  5. Iñaki Baz Castillo
    Replies:
    7
    Views:
    867
    Iñaki Baz Castillo
    Jan 12, 2010
Loading...

Share This Page