DataReader and Returned Parms

Discussion in 'Microsoft ADO .NET' started by Jim Heavey, Dec 19, 2003.

  1. Jim Heavey

    Jim Heavey Guest

    I have found that I am unable to read the parms until after I do a close on
    the DataReader. Is that accurate?

    In the instance where you are executing a procedure which returns multiple
    answer sets, would this still be true?

    So if I wanted to get the return value for each of the answer sets, I would
    in the Procedure create a variable which would hold the RETURN_Value into
    something like RETURN_VALUE1, RETURN_VALUE2....etc? Then after all the
    answer sets have been returned I could then read the parameter return
    values?

    Thanks in Advance for your assistance....
     
    Jim Heavey, Dec 19, 2003
    #1
    1. Advertisements

  2. Jim Heavey

    Miha Markic Guest

    Hi Jim,

    Yes, I think that you can read the return parameters only after you've read
    all rows.

    --
    Miha Markic - RightHand .NET consulting & software development
    miha at rthand com
    www.rthand.com

    "Jim Heavey" <> wrote in message
    news:Xns945657AD199C9JimHeaveyhotmailcom@207.46.248.16...
    > I have found that I am unable to read the parms until after I do a close

    on
    > the DataReader. Is that accurate?
    >
    > In the instance where you are executing a procedure which returns multiple
    > answer sets, would this still be true?
    >
    > So if I wanted to get the return value for each of the answer sets, I

    would
    > in the Procedure create a variable which would hold the RETURN_Value into
    > something like RETURN_VALUE1, RETURN_VALUE2....etc? Then after all the
    > answer sets have been returned I could then read the parameter return
    > values?
    >
    > Thanks in Advance for your assistance....
     
    Miha Markic, Dec 19, 2003
    #2
    1. Advertisements

  3. Jim Heavey

    bruce barker Guest

    mostly correct, the parameters are returned after all result sets, you don't
    need to close, just read all rows, for all result sets first (see
    NextResult())

    -- bruce (sqlwork.com)

    "Jim Heavey" <> wrote in message
    news:Xns945657AD199C9JimHeaveyhotmailcom@207.46.248.16...
    > I have found that I am unable to read the parms until after I do a close

    on
    > the DataReader. Is that accurate?
    >
    > In the instance where you are executing a procedure which returns multiple
    > answer sets, would this still be true?
    >
    > So if I wanted to get the return value for each of the answer sets, I

    would
    > in the Procedure create a variable which would hold the RETURN_Value into
    > something like RETURN_VALUE1, RETURN_VALUE2....etc? Then after all the
    > answer sets have been returned I could then read the parameter return
    > values?
    >
    > Thanks in Advance for your assistance....
     
    bruce barker, Dec 19, 2003
    #3
  4. Jim Heavey

    William Ryan Guest

    Check out Bill Vaughn's article Retrieving the Gozoutas
    http://www.betav.com/msdn_magazine.htm
    "Jim Heavey" <> wrote in message
    news:Xns945657AD199C9JimHeaveyhotmailcom@207.46.248.16...
    > I have found that I am unable to read the parms until after I do a close

    on
    > the DataReader. Is that accurate?
    >
    > In the instance where you are executing a procedure which returns multiple
    > answer sets, would this still be true?
    >
    > So if I wanted to get the return value for each of the answer sets, I

    would
    > in the Procedure create a variable which would hold the RETURN_Value into
    > something like RETURN_VALUE1, RETURN_VALUE2....etc? Then after all the
    > answer sets have been returned I could then read the parameter return
    > values?
    >
    > Thanks in Advance for your assistance....
     
    William Ryan, Dec 19, 2003
    #4
    1. Advertisements

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

    dotNet - syntax for parms in SQL Connection?

    kate, Aug 11, 2003, in forum: Microsoft ADO .NET
    Replies:
    2
    Views:
    767
    Sudha
    Aug 12, 2003
  2. Larry Lowry

    DataReader, mySQL and Text fields

    Larry Lowry, Aug 13, 2003, in forum: Microsoft ADO .NET
    Replies:
    2
    Views:
    420
    Larry Lowry
    Aug 13, 2003
  3. Guest
    Replies:
    1
    Views:
    578
    David Browne
    Aug 8, 2004
  4. TY

    DataReader Limits data returned!

    TY, Jan 26, 2006, in forum: Microsoft ADO .NET
    Replies:
    3
    Views:
    2,736
    djstew
    May 16, 2012
  5. Guest

    RE: Displaying parms in Profiler when using DSN

    Guest, Apr 19, 2006, in forum: Microsoft ADO .NET
    Replies:
    2
    Views:
    171
    Guest
    Apr 20, 2006
Loading...

Share This Page