title: C# External component has thrown an exception
body: <p>Backend database: <strong>Access</strong>. There are unhandled exception crushing the application. I am trying to use Try/Catch/Finally, and play around the application to identify code error one at a time. There may be many places causing unhandled exceptions, but I guess some of them are similar issue. I just play around and fix where I found.</p>
  <p>Here is the first place causing exception error. Let me explain how I got here. First, I click ChildForm1 buttonXYZ, and the query returns no record; Then I click parent form menustrip button and try to open ChildForm2. The error comes up at ChildForm2_Load line Cn.Open. Here is error screenshot.</p>
  <p>What goes wrong, and how to fix it?</p>
  <p>Thanks.</p>
  <p><a href="https://i.stack.imgur.com/PCMIH.jpg" rel="nofollow noreferrer">enter image description here</a></p>
  <p><a href="https://i.stack.imgur.com/N1FyL.jpg" rel="nofollow noreferrer">enter image description here</a></p>
  <pre><code>     //First, I click ChildForm1 buttonXYZ, and the query returns no record
   private void buttonXYZ_Click(object sender, EventArgs e)
   {
      
       try
       {
           Cn.Open();
           string sqlStr = &quot;SELECT ......&quot;;
           adapt = new OdbcDataAdapter(sqlStr, Cn);
           dt = new DataTable();
           adapt.Fill(dt);
           dgvABC.DataSource = dt;
       }
       catch (Exception ex)
       {
           Console.WriteLine(ex.Message);
           MessageBox.Show(ex.Message);
       }
       finally
       {
           Cn.Close();
       }
      
   }
      
      
      
   //Then I click parent form menustrip button and try to open ChildForm2
   private void OpenChildForm2ToolStripMenuItem_Click(object sender, EventArgs e)
   {
       if (ActiveMdiChild != null)
           ActiveMdiChild.Close();
      
       ChildForm2 childForm2 = new ChildForm2();
       childForm2.MdiParent = this;
       childForm2.WindowState = FormWindowState.Maximized;
       childForm2.Show();
   }
  </code></pre>