4

I've been using SqlList() to receive result sets from SPs and it is handy.

var people = db.SqlList<Person>("EXEC GetRockstarsAged @age", new { "age", 42 });

but how can I use this OrmLite to get multiple result sets from a single SP? Using the above approach only seems to retrieve the first result set.

detale
  • 12,482
  • 4
  • 41
  • 42
  • 1
    I am not sure that OrmLite supports multiple result sets. – Akira Yamamoto May 22 '14 at 14:22
  • 2
    OrmLite supports calling SP's with [multiple output parameters](https://github.com/ServiceStack/ServiceStack.OrmLite#stored-procedures-with-output-params) but not multiple result sets, although OrmLite does include an embedded version of Dapper in the `ServiceStack.OrmLite.Dapper` namespace. – mythz Jan 27 '15 at 18:33

1 Answers1

5

Unfortunately, ServiceStack.OrmLite does not support multiple result sets unless combined with Dapper. ServiceStack MARS (Multiple Active Result Sets) using ORMLite and Output Parameters

Alternatively, you can use the .Net SqlCommand. Return multiple recordsets from stored proc in C#

ServiceStack.OrmLite V4 notes: https://github.com/ServiceStack/ServiceStack.OrmLite

ServiceStack.OrmLite V3 notes: https://github.com/ServiceStack/ServiceStack.OrmLite/tree/v3

Community
  • 1
  • 1
SgtRock
  • 191
  • 1
  • 9