title: How to catch SQLServer timeout exceptions
body: <p>I need to specifically catch SQL server timeout exceptions so that they can be handled differently.  I know I could catch the SqlException and then check if the message string Contains "Timeout" but was wondering if there is a better way to do it?</p>
  
  <pre><code>try
  {
      //some code
  }
  catch (SqlException ex)
  {
  
      if (ex.Message.Contains("Timeout"))
      {
           //handle timeout
      }
      else
      {
           throw;
      }
  }
  </code></pre>