I'm working with ASP.Net, C# and SLQ Server. So far, I have created a Store Procedure that return one result set.
Then, I created a type dataset from my application and I configured it to read the data from the Store procedure. At this point, everithing is working OK.
But now, I would like to add a new query to the Sproc to return two result sets. However doing this, now I'm not sure how I can configure my type dataset to support multiple result set.
So the questions are:
1.- Is that posible?
2.- Is there a better way to achieve it?
I have solve it, using an SqlDataAdapter instead of a TableAdapter (which can be generated when adding a type dataset). I leave my type dataset but this time without the tableAdaperte (Fill(9 and GetDAta()).
Then I used the Fill() method from the SqlDataAdapter I created. In that way you can get multiple resultSet from a Stored Prodcedure :-)
Lesthad_mk
Member
98 Points
161 Posts
How to set a typed dataset to read an SP with two result sets?
Apr 20, 2012 09:31 PM|LINK
Hi all
I'm working with ASP.Net, C# and SLQ Server. So far, I have created a Store Procedure that return one result set.
Then, I created a type dataset from my application and I configured it to read the data from the Store procedure. At this point, everithing is working OK.
But now, I would like to add a new query to the Sproc to return two result sets. However doing this, now I'm not sure how I can configure my type dataset to support multiple result set.
So the questions are:
1.- Is that posible?
2.- Is there a better way to achieve it?
Any suggestion or clue would be very helpful
Thanks and Regards!
Shoaib Rashi...
Member
291 Points
116 Posts
Re: How to set a typed dataset to read an SP with two result sets?
Apr 20, 2012 09:43 PM|LINK
please make it clear result returned from store procedure is singlton value or record set .
Lesthad_mk
Member
98 Points
161 Posts
Re: How to set a typed dataset to read an SP with two result sets?
Apr 20, 2012 09:48 PM|LINK
Hi Shoaib
I forgot to mention that. Well, in this case both of them. The first result is a scalar value and the second one is a record set.
Regards!
Lesthad_mk
Member
98 Points
161 Posts
Re: How to set a typed dataset to read an SP with two result sets?
Apr 21, 2012 12:11 AM|LINK
Hi again
I have solve it, using an SqlDataAdapter instead of a TableAdapter (which can be generated when adding a type dataset). I leave my type dataset but this time without the tableAdaperte (Fill(9 and GetDAta()).
Then I used the Fill() method from the SqlDataAdapter I created. In that way you can get multiple resultSet from a Stored Prodcedure :-)
I found the folowing link where it's explained a little better. http://www.pcreview.co.uk/forums/strongly-typed-datasets-can-table-adapter-handle-multiple-resultsets-t3574525.html
Hope this help ;-)
Cheers!!!