title: How get correct Exception from ADO.NET about foreign key violation
body: <p>I would like to get correct Exception from ADO.NET about foreign key violation.  Is there a way to do that?</p>
  
  <p>I am using try to catch ADO.Exception and check it message text for 'foreign'. So, if there is 'foreign' text in exception text, it is a violation and I can alert.</p>
  
  <p>Is it the right way to do or any other method? </p>
  
  <pre><code>try{
      base.Delete();
  IList&lt;Issue&gt; issues = Issue.LoadForX(this);
  foreach (Issue issue in issues)
  {
    issue.X= null;
    issue.SaveAndCheckChanged(user);
  }
  
  }
  catch(NHibernate.ADOException exception)
  {...
  </code></pre>