I have the following C#.Net code that I am trying to get to return the stored procedure results along with the schema of those results. Below is how my code (simplified) currently looks...
Database db = DatabaseFactory.CreateDatabase();
DbCommand dbCommand = db.GetStoredProcCommand("MyStoredProcedure");
IDataReader drData = db.ExecuteReader(dbCommand);
DataTable tblSchema;
tblSchema = drData.GetSchemaTable();
The GetSchemaTable is returning empty. I have read that I need to pass CommandBehavior.KeyInfo to the Executereader method but I am unclear how this would look in the way I have the code structured since I am passing the dbCommand to the Executereader.