I am developing an ASP.NET app with VB.NET and tying it into our existing DB2 database. I have recently started to use stored procedures and I am experience varied results with the following senerio.
I have code to fill a dataset (three tables) so I created a stored procedure on the iSeries to return 3 result sets each are Select statements to three files and they work beautifully when ran interactive, all three are pulled back.
Next I implemented it in .NET. I get two tables filled and the third empty.
I then experimented I had the stored procedure return the third table second and modified the VB code to fill the first and third then second table. Again only two tables where populated but this time it was the first and third.
Does anyone know if the communication between .NET and iSeries is causing this to occur, or if the stored procedure is not set up correctly?
Any assistance will be greatly appreciated. I am stumped!!!
You might want to check the stored procedure (CREATE STORED PROCEDURE ddl) parameter definition and there might be a parameter that specifies how many result sets are expected (RESULT SET <integer>) out of the stored procedure.
Try setting it 3; i.e. RESULT SET 3 and let me know how it works.
This should fix the problem. I don't think there would be problem in handling multiple result sets (cursors or recordsets) within DATASET.