I have stored procedures (they accept parameters) that return multiple result sets and I'd like to have this saved in a typed dataSet.
The question is: can I have Visual studio 2010 generate the typed dataset based on stored procedure? I know I can have this for a single table, but I need the whole dataSet (multiple tables, one for each result set)
So let's do an experiment to see if it is possible..
I created the following stored procedure in a SQL 2008 database:
CREATE PROCEDURE dbo.StackOverflow3668337
AS
BEGIN
SET NOCOUNT ON;
SELECT 'First bit';
SELECT 'Second bit';
END
Then I created a new project in VS2010, and added a DataSet item to the project.
I created a connection to the database in the Server Explorer, and dragged the 'StackOverflow3668337' item onto the DataSet designer surface. This is the result:
So that would be just one DataTable. So unfortunately I think the answer is out of the box, "No".
I think the main reason for this is that the TableAdapter classes that are generated are just tied to a single DataTable. You can have multiple TableAdapters for a single DataTable but they all need to return the same data. There is no capacity for a single TableAdapter to interact with additional DataTables.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With