stored procedure Q...

Discussion in 'ASP .Net' started by Carl San, Mar 24, 2005.

  1. Carl San

    Carl San Guest

    I am using ADO.Net in VB.net application. .Net Framework 1.1.



    In a stored procedure I have multiple output parameters and multiple result
    sets. How to code for this in ADO.Net?

    I have used MyCommandObject.ExecuteNonQuery() when there were only output
    parameters and no rows were returned from stored procedure.



    I have used

    Dim MyDataReader As SqlDataReader = MyCommandObject.ExecuteReader() when I
    wanted to read one set of result set returned by stored procedure.



    How to call a stored procedure when I have multiple output parameters and
    multiple results sets?

    Thanks,

    Carl
     
    Carl San, Mar 24, 2005
    #1
    1. Advertising

  2. Carl San

    Brock Allen Guest

    Once you get back SqlDataReader you can iterate over the results from the
    first result set via Read() (don't forget that this is forward-only read-only).
    If there are more result sets then call NextResult() to move to the next
    one. This returns false if there are no other result sets. Once you've called
    this method then you can iterate over the rows of the next resultset with
    Read() just like the first results.

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > I am using ADO.Net in VB.net application. .Net Framework 1.1.
    >
    > In a stored procedure I have multiple output parameters and multiple
    > result sets. How to code for this in ADO.Net?
    >
    > I have used MyCommandObject.ExecuteNonQuery() when there were only
    > output parameters and no rows were returned from stored procedure.
    >
    > I have used
    >
    > Dim MyDataReader As SqlDataReader = MyCommandObject.ExecuteReader()
    > when I wanted to read one set of result set returned by stored
    > procedure.
    >
    > How to call a stored procedure when I have multiple output parameters
    > and multiple results sets?
    >
    > Thanks,
    >
    > Carl
    >
     
    Brock Allen, Mar 24, 2005
    #2
    1. Advertising

  3. Carl San

    Bruce Barker Guest

    and once you've processed all the results (NextResult() returns false), you
    can access the output parameters.

    -- bruce (sqlwork.com)



    "Brock Allen" <> wrote in message
    news:...
    > Once you get back SqlDataReader you can iterate over the results from the
    > first result set via Read() (don't forget that this is forward-only
    > read-only). If there are more result sets then call NextResult() to move
    > to the next one. This returns false if there are no other result sets.
    > Once you've called this method then you can iterate over the rows of the
    > next resultset with Read() just like the first results.
    >
    > -Brock
    > DevelopMentor
    > http://staff.develop.com/ballen
    >
    >
    >
    >> I am using ADO.Net in VB.net application. .Net Framework 1.1.
    >>
    >> In a stored procedure I have multiple output parameters and multiple
    >> result sets. How to code for this in ADO.Net?
    >>
    >> I have used MyCommandObject.ExecuteNonQuery() when there were only
    >> output parameters and no rows were returned from stored procedure.
    >>
    >> I have used
    >>
    >> Dim MyDataReader As SqlDataReader = MyCommandObject.ExecuteReader()
    >> when I wanted to read one set of result set returned by stored
    >> procedure.
    >>
    >> How to call a stored procedure when I have multiple output parameters
    >> and multiple results sets?
    >>
    >> Thanks,
    >>
    >> Carl
    >>

    >
    >
    >
     
    Bruce Barker, Mar 24, 2005
    #3
    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. Sarmad Aljazrawi

    New Stored Procedure Template in .Net

    Sarmad Aljazrawi, Dec 16, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    553
    Sarmad Aljazrawi
    Dec 16, 2003
  2. ES
    Replies:
    2
    Views:
    1,554
    jgy3183
    Aug 20, 2004
  3. Patrick
    Replies:
    2
    Views:
    5,990
    Gopinath S
    Feb 15, 2005
  4. Mike P
    Replies:
    0
    Views:
    3,381
    Mike P
    Jun 19, 2006
  5. AlexWare
    Replies:
    2
    Views:
    789
    Paul Uiterlinden
    Oct 23, 2009
Loading...

Share This Page