I use Dapper dot net to execute a stored procedure that returns 4 result sets. Here is how I do it:
public Results Search(Query query) { if (query == null) throw new ArgumentNullException("query"); Results results; var q = _sqlConnection.QueryMultiple("MySchema.MySproc", query, commandType: CommandType.StoredProcedure); { results = q.Read<Results>().First(); results.CheckAlertResults = q.Read<Results.CheckAlertResult>().ToArray();
The first result set will contain only 1 row. This corresponds to a few primitive properties in my Results class.
The remaining 3 result sets will have many rows and will be filled with 3 complex array properties in the Results class.
For some reason I get
Unable to access the remote object. Object Name: "GridReader".
Check out my code to see where.
I checked that the procedure works correctly when calling LinqPad, which uses Linq2Sql.
What am I doing wrong?
source share