Return list of columns in user-provided subquery
Just pull the DataTable object(s) and enumerate the DataColumnCollection.  Here is some sample code to show how you can enumerate the collection and dump the column names:

DataTable queryResults = // get your data

foreach (DataColumn column in queryResults.Columns)
    Console.WriteLine("Column Name :: {0}", column.ColumnName);


Of course this is an extremely rudimentary illustration, but it shows what you need: