1

I'd like to know if it is possible to call a multi-table stored procedure using Massive and return multiple tables. The old-school way of doing this was as follows using ADO.NET

SqlCommand command = new SqlCommand("UserAppData", conn);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add("@UserID", SqlDbType.UniqueIdentifier).Value = (Guid)user.ProviderUserKey;
SqlDataAdapter adapter = new SqlDataAdapter(command);
DataSet ds = new DataSet();
adapter.Fill(ds);
DataTable dt0 = ds.Tables[0];
DataTable dt1 = ds.Tables[1];
DataTable dt3 = ds.Tables[2];
DataTable dt4 = ds.Tables[3];

The ideal solution would execute the stored procedure and then have dynamic objects (different table schemas) per table, named by table.

If this isn't possible, any other solution that returns these tables as dynamic objects without using the dt0.Rows[0]["ColumnName"] syntax will be accepted. Something like dt0.Rows.First().UserId is what I'm looking for.

bkaid
  • 51,465
  • 22
  • 112
  • 128
aarondcoleman
  • 536
  • 7
  • 9

0 Answers0