title: try/catch exceptions
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/9526139/how-to-catch-exceptions">How to catch exceptions</a>  </p>
  </blockquote>
  
  
  
  <p>I have not really had to use try and catch exceptions. I am trying to use a try/catch to trap for potential errors. Now I am not to sure where to put the try and catch this is the code I have right now..</p>
  
  <pre><code> divide d;
      private void button1_Click(object sender, EventArgs e)
      {
          d = new divide(int.Parse(textBox1.Text), int.Parse(textBox2.Text));
          int total = d.CalculateDivision();
          MessageBox.Show(total.ToString());
      }
  </code></pre>
  
  <p>now would I put it under here with </p>
  
  <pre><code>try
  {
  
  }
  catch
  {
  MessageBox.Show("error");
  }
  </code></pre>
  
  <p>or would I add the try/ catch somewhere in the code.</p>