I have a SQL Server data table that has an xml column. I run a select query using DataTable
(Fill
method of the SqlDataAdapter
class). After execution, the type of the column is string
.
I am wondering how I could determine the actual SQL Server datatype (in this case xml
) from the DataTable
materialized by the Fill
method.
I cannot use SqlDataReader
(which has GetSchemaTable
method that returns the SQL Server datatype information) - I have to use SqlDataAdapter/DataTable
. Doing something like:
DataTableReader reader = new DataTableReader(table);
DataTable schemaTable = reader.GetSchemaTable();
is also not helpful since it also does not seem to contain the SQL Server datatype information.