title: Given a T-SQL type as a string, what is the easiest way to evaluate it to a .Net Type?
body: <p>If given a string that contains a SQL Server/T-SQL datatype, what is the easiest way to evaluate the the string to a .Net Type?</p>
  
  <p>For instance, if you have a string containing "<em>nvarchar</em>", the result returned by the conversion method should be a the <code>System.String</code> Type.  If I have a string containing "<em>int</em>", the result should be a <code>System.Int32</code> Type object.</p>
  
  <p>I could easily write a function that takes a SQL datatype string and sends the string through a switch/case statement that returns a .Net Type object.  However, I wasn't sure if there was a function buried in the .Net framework that I overlooked that already does this.</p>
  
  <p>What is the easiest/correct way to resolve a SQL Server datatype to a .Net datatype?</p>
  
  <p><strong>ADDITIONAL CONTEXT</strong></p>
  
  <p>In my case, I actually have a stored procedure that returns some meta-information about data.  Specifically, a string field is returned, containing a sql-type value which could be any sql-type that was available within SQL Server 2005.</p>
  
  <p>My stored procedure has the potential to return any sql-type-- <code>int</code>, <code>smallint</code>, <code>datetime</code>, <code>binary</code>, etc.  I need to take this data type and convert it to a .Net <code>Type</code> object.  </p>
  
  <p>Matthew's comment below does provide all of the necessary mapping information, straight from Microsoft's documentation but, again, I was wondering if there was something integrated in either the <code>System.Data</code> or <code>System.Data.SqlClient</code> namespaces.</p>