Geeks With Blogs

News

This blog has moved to ericnelson.wordpress.com

 Subscribe in a reader

Add to Google Reader or Homepage


Links
View my teams slideshare
These postings are provided "AS IS" with no warranties, and confer no rights.



IUpdateable has moved to ericnelson.wordpress.com Please visit http://ericnelson.wordpress.com

This one has come up for both LINQ to SQL and LINQ to Entities. The scenario is a reasonably common one. How to handle something like this:

CREATE PROCEDURE [dbo].[ReturnMultipleRS] 
AS
select * from customers
select * from products

LINQ to SQL:

The solution is to add a method to the DataContext using a partial class. Thankfully the Swiss MSDN team have already explained this one in great detail. Enjoy.

LINQ to Entities:

The easiest approach is to download the ADO.NET Entity Framework Extensions which enables multiple result set support. The download is tiny but still includes a sample project which demonstrates (among other things) working with multiple result sets to return categories and products.

Posted on Wednesday, January 21, 2009 2:47 PM .NET 3.5 , Data , LINQ , Entity Framework , ORM , Q&A | Back to top


Comments on this post: QandA: How to return multiple result sets from a stored procedure using LINQ

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Eric Nelson | Powered by: GeeksWithBlogs.net