stored procedure Q...

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
 
B

Brock Allen

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

Bruce Barker

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

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top