title: C# app stays in task manager after closing
body: <p>I'm testing my C# app from the <code>bin/Release</code> the app works perfectly but whenever I close the application the name still appears in the task manager, and if I try to open it again it opens and another process still shows in the task manager
  So if I open the app 10 times, 10 processes will show in the task manager.</p>
  
  <p>I changed my code to close the form from this.Hide() to this.Close() but the problem stayed :(</p>
  
  <p>what might be the problem.
  I'm not using threads in my application, do I need to post parts of my code?</p>
  
  <p>Edit:
  this is the login form (form 1)</p>
  
  <pre><code>if ((aun.Text != "") &amp;&amp; (apw.Text != ""))
  {
      try
      {
          ConnectionInfo.con.Open();
          string un, pw;
          SqlCommand cmd2 = new SqlCommand("Select un,pw from creden where creden.un=@un", ConnectionInfo.con);
          cmd2.Parameters.AddWithValue("@un", aun.Text);
          SqlDataReader dr2 = cmd2.ExecuteReader();
  
          dr2.Read();
  
          un = dr2.GetString(0);
          pw = dr2.GetString(1);
  
          dr2.Close();
          if ((un == aun.Text) &amp;&amp; (pw == apw.Text))
          {
              dashboard d1 = new dashboard(aun.Text);
              this.Close();d1.Show();
  
          }//end if similar credentials entered
          else
          {
              MessageBox.Show("لقد أدخلت كلمة بيانات خاطئة الرجاء التأكد ");
          }//end if wrong pw is entered
      }//end try
      catch (Exception ex)
      {
          MessageBox.Show("هنالك خطأ في اسسم المستخدم");
      }
      finally 
      {
          ConnectionInfo.con.Close();
      }
  
  }//end if
  else
  {
      MessageBox.Show("الرجاء أدخل جميع البيانات");
  }//end else
  </code></pre>
  
  <p>this is the second form </p>
  
  <pre><code>public dashboard(string x)
  {
      InitializeComponent();
      label3.Text = x;
  }
  
  private void button1_Click(object sender, EventArgs e)
  {
      Products pdts = new Products(label3.Text);
      this.Close();
      pdts.Show();
  }
  
  private void button2_Click(object sender, EventArgs e)
  {
      Capital c = new Capital(label3.Text);
      this.Close();
      c.Show();
  }
  </code></pre>