How LinqToSql Generates Stored Procedure Output
1 answer
That's what's going on in SqlCommandBuilder.GetSchemaTable(...)
, which, unfortunately, is protected
.
SqlCommand command; // setup as SP
using (SqlDataReader reader = command.ExecuteReader(
CommandBehavior.KeyInfo | CommandBehavior.SchemaOnly))
{
return reader.GetSchemaTable();
}
The result DataTable
will contain the output schema.
If I remember correctly, you don't need to pass parameters for this to work.
+3
source to share