title: WinForms Exception handling
body: <p>I got a method that is filling dataset from db which looks like more or less like this:</p>
  
  <pre><code>private DataSet GetData(string query)
  {
      try
      {
          //do some stuff to populate dataset
          return dataset;
      }
      catch (SqlException ex)
      {
          MessageBox.Show("There was a database error. Please contact administrator.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
          LogExceptionToFile(ex); //to log whole exception stack trace, etc.
      }
      finally
      {
          //cleanup
      }
  }
  
  //calling methods:
  GetData(query);
  OtherMethod1(); //this method shows message box of success
  </code></pre>
  
  <p>When I have that piece of code in case of exception I got my user friendly message box and then <code>OtherMethod1()</code> is called and it shows success message box. I would like to stop if in <code>GetData()</code> there is an error. When I add <code>throw;</code> to this catch block after my message box, there is another message box shown than unhandled exception was thrown. I would like to avoid this second message box to be shown if I have friendly message provided.</p>