how to fill a dataset from a DB2 stored procedure

A

Ashish Sheth

Hi all gurus,
I am using a DB2 stored procedure which selects some data from a table and
opens a cursor. I want to take this data in a Dataset... but when I use the
Dataadapter's fill method the dataset doesnot contain any data. How can I
fetch the data from the cursor to the Dataset?

thanks and regards,
Ashish Sheth
 
W

William \(Bill\) Vaughn

How many Tables were created by Fill?

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
F

Frans Bouma [C# MVP]

Ashish said:
Hi all gurus,
I am using a DB2 stored procedure which selects some data from a table and
opens a cursor. I want to take this data in a Dataset... but when I use the
Dataadapter's fill method the dataset doesnot contain any data. How can I
fetch the data from the cursor to the Dataset?

Which provider do you use? OleDB? In that case I don't think there is a way
to bind the cursor to a datatable...

Frans.
 
A

Ashish Sheth

Hi all,
thanks for the reply. I found the solution. Actually it works exactly the
same as fetching rows from a stored procedure in SQL Server. Only thing I
have to do is while declaring a cursor in the stored procedure in DB2 I have
to use 'WITH RETURN TO CLIENT' clause.

like this:
Declare cursor myCursor WITH RETURN TO CLIENT for myQuery

thanks and regards,
Ashish Sheth
 

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