Retrieve multiple resultsets from a stored procedu
I need bind multiple resultsets from a stored procedure in DB2 to a datagrid or dataTable. How to do that? I know how to do it with SQL server as you can use .nextResult() to navigate throght the resultsets. thanks!
RE: Retrieve multiple resultsets from a stored pro
" need bind multiple resultsets from a stored procedure in DB2 to a datagrid or dataTable"<BR><BR>first off:<BR>DataGrid = Presentation<BR>DataTable = Data Storage<BR><BR>so it would be one or the other...<BR><BR>what you need to do is fill the multiple "recordsets" into a DataSet... then the DataSet will have multiple DataTables inside with can be accessed by<BR><BR>ds.Tables(0) <<== first recordset<BR>ds.Tables(1) <<== second recordset<BR>ds.Tables(2) <<== third recordset<BR>etc....
The issue is that a DB2 stored procedure has 3 select...from... and each is associated with a cursor, then how to bind those results into one datagrid control. This article is good, but it deals with SQL server:<BR>http://www.codeproject.com/aspnet/DataGridMultipleResultset.asp
I have never used DB2, but I would assume that MorningZ's suggestion would still be relevant. If we are misguided, could you please explain how a DB2 SPROC that returns multiple result sets is different from a SQL Server SPROC that returns multiple result sets?