how to fill a dataset from a DB2 stored procedure

  • Thread starter Thread starter Ashish Sheth
  • Start date Start date
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
 
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.
__________________________________
 
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.
 
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
 
Back
Top