bamapie
asked on
multiple from recordsets SQL->C# app
I have a SQL stored proc that returns multiple recordsets from multiple queries. When I run it in SQL Mgmt Studio, it works great. Currently I get back 3 tables with a few dozen records in each. Correct results.
When I call this from C# code, using SqlAdapter.Fill() into a DataSet, I do indeed get 3 tables in my DataSet. It's just that they're totally empty.
I'm using the same parameters in each call.
So let me just ask this, right off the bat: Is reading these multiple recordsets into a DataSet not going to ever return results? If it should be working, is there perhaps a known wrinkle regarding multiple recordsets somewhere that I'm missing?
Thanks
When I call this from C# code, using SqlAdapter.Fill() into a DataSet, I do indeed get 3 tables in my DataSet. It's just that they're totally empty.
I'm using the same parameters in each call.
So let me just ask this, right off the bat: Is reading these multiple recordsets into a DataSet not going to ever return results? If it should be working, is there perhaps a known wrinkle regarding multiple recordsets somewhere that I'm missing?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can test Jim's theory by only returning 1 dataset from your stored procedure and see if it works. If it doesn't, then the issue is not with multiple datasets, but something else, like not setting SET NOCOUNT ON in your stored procedure.
ASKER
Thanks!
In my SQL stored procedure, I return 3 datasets using select statements:
Open in new window
Then, in C#:
Assign parameters and call the stored procedure with execute():
Open in new window