title: Is System.Data.SqlClient.SqlException.Number the same in all version's of SQL Server?
body: <p>I want to categorize the <code>SQL Exception</code> only for <em><code>Login failed for user 'username'</code></em> message on catch block. So I tried this way.</p>
  
  <pre><code>   if(exception.Number == 18456)
         return false;
     else
         throw exception;
  </code></pre>
  
  <p>I want to <code>throw all other exception</code> other than login failed.</p>
  
  <p>Is the Number I am using here the same for this error text in all version's of Sql Server?</p>