title: How to get the SqlType of a column in a DataTable?
body: <p>I have a DataTable obtained from a SQL DataBase, like this:</p>
  
  <pre><code>using (SqlCommand cmd = new SqlCommand(query, _sqlserverDB))
  {
      using (SqlDataAdapter adapter = new SqlDataAdapter(cmd))
      {
          DataSet dataSet = new DataSet();
          adapter.Fill(dataSet);
          result = (dataSet != null &amp;&amp; dataSet.Tables != null &amp;&amp; dataSet.Tables.Count &gt; 0) ? dataSet.Tables[0] : null;
      }
  }
  </code></pre>
  
  <p>When I try to get the DataType of each column through dataColumn.DataType , I get the C# types (Int32, Int64, String, etc).</p>
  
  <p><strong>QUESTION:</strong> How can I access the native SQL data types (varchar, nvarchar, bigint...) instead of the C# types?</p>
  
  <p>I have tried dataColumn.DataType.UnderlyingSystemType and the result is the same.</p>