How to get table name of a column from SqlDataReader
I have an SQL query I get from a configuration file, this query usually contains 3-6 joins. I need to find at run time, based on the result set represented by SqlDataReader, to find the name of the table for each column. Here are some thing that don't work: SqlDataReader.GetName returns the column name but not the table name. SqlDataReader.GetSchemaTable returns a data table with column information - but all the table names are null. Querying information_schema doesn't help because I need data on the results of the current query (and the column names are not unique - there are columns with the