stored procedure Q...

  • Thread starter Thread starter Carl San
  • Start date Start date
C

Carl San

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
 
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
 
and once you've processed all the results (NextResult() returns false), you
can access the output parameters.

-- bruce (sqlwork.com)
 
Back
Top