Why if in SQL Server, I have a column defined as XML type, and in .NET with SqlDataReader/SqlDataAdapter I have a string?
See the example in the screenhsot, cast c1 in XML, but .NET gets a string.
I tried also with XML column, always string.
This my code
SqlCommand sc = new SqlCommand("select *, convert(xml, c1) c6 from tempdb..t1", conn);
DataTable dt = new DataTable();
new SqlDataAdapter(sc).Fill(dt);
How can I recognize a XML result to cast only when necessary?

GetSqlXmlif you have a reader learn.microsoft.com/en-us/dotnet/api/… but otherwise it will just turn it into astring.reader.GetDataTypeName tells you the type. By the way your code in the screenshot rather ominously uses bothSqlDataAdapter` andSqlDataReaderwhich means you are probably executing the command twice. You are also missingusingto dispose everything.