Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to return multiple result sets using ExecuteQuery in Linq to Sql?

I know that you can return multiple results from a stored procedure and through the method generated by the designer.

However, I'm trying to do the same using ExecuteQuery but it doesn't seem like it's possible. Has anyone tried or know whether this is possible?

Basically I'm trying to run an ad-hoc stored procedure. By ad-hoc, I mean a stored procedure that wasn't available during design-time.

like image 893
Jiho Han Avatar asked Nov 15 '22 09:11

Jiho Han


1 Answers

It appears that ExecuteQuery, since it always returns IENumerable, is always going to only process the first resultset. You will want to work with IMultipleResults instead. This may be a starting point: http://www.a2zmenu.com/Blogs/LINQ/multiple-result-sets-using-IMultipleResults-in-linq.aspx

like image 138
Ross Presser Avatar answered Dec 22 '22 13:12

Ross Presser