returning dataset from stored procedure

M

Mike P

How do you return a dataset from a stored procedure so that you can
iterate through the rows returned?



Thanks in advance,

Mike
 
N

Nicholas Paldino [.NET/C# MVP]

Mike,

You don't. The stored procedure can return a result set (basically, a
select off of a table, or something of that nature).

Once you have the stored procedure, you can call it by using a
SqlCommand object which makes the call. The SqlCommand object will return a
SqlDataReader.

Or, you can attach the same SqlCommand object to the SelectCommand
property of a SqlDataAdapter, which will then populate a DataSet for you
when you call the Fill method.

Hope this helps.
 

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

Top