2

I want to build few stored procedures which will be returning multiple recordsets. I want to know, how can I use them in Entity Framework?

3 Answers 3

4

Entity framework doesn't support multiple result sets currently but the support is already included in EF June 2011 CTP (it is first CTP of upcoming EF 4.2).

If you want to have stored procedures with multiple result sets in EF 4 or EF 3.5 you can check EFExtensions.

Sign up to request clarification or add additional context in comments.

Comments

1

As far as I know, Entity Framework can't handle multiple recordsets from a stored procedure.

If you need multiple record sets, you'll have to drop back to class ADO.NET and map the different DataTables by hand.

If you're willing to jump into a CTP version of Entity Framework, you could attempt to use the method found here:

Entity Framework CTP5 - Reading Multiple Record Sets From a Stored Procedure - StackOverflow

2 Comments

Hmm .. that solution is not great too. Since we ave to open another connection in any ways. By the way is it recommended to have a SP returning multiple recordsets? or we should build separate ones?
@eFriend - Personally, I always write separate procedures in that case.
0

Having run into this issue myself, the only way around it was to either split the sprocs or fall back to classic ADO.Net as suggested. I my case splitting the sprocs was the route that we used.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.