title: refresh datagridview when ever i hit insert button
body: <p>i have searched for the answer for this particular question for way too long but i get no clear help. </p>
  
  <p>can you help me with refreshing the datagrid view . when ever i click insert button else i have to restart my program to see recently updated data. 
  i have tried using datagridview.refresh(); 
  and datagridview.update(); in both datagridview and insert button code but it wont work. this is my code for inserting data in database :</p>
  
  <pre><code>private void btnSave_Click(object sender, EventArgs e)
  {
      DatabaseConnection dbcon = new DatabaseConnection();
      dbcon.OpenDbConnection();
      dbcon.commandConnection();
  
      gender1();
  
      string query = "Insert into Employee_personal_info (Last_Name,Middle_Name,First_Name,Phone_Number,Email_Address,Permanent_Address,Temporary_Address,Gender,userimage) values ('" + textBoxLastName.Text + "','" + textBoxMiddleName.Text + "', '" + textBoxFirstName.Text + "','" + textBoxPhoneNumber.Text + "','" + textBoxEmailAddress.Text + "','" + textBoxPermanentAdd.Text + "','" + textBoxTemporaryAdd.Text + "','" + gender1() + "','"+textBox_imagepath.Text+"') ";
  
      string query2 = "Select @@Identity";
      int ID;
  
      try
      {
          dbcon.commandExecuteNonQuery(query);
  
          ID = (int)dbcon.commandExecuteScalar(query2);
  
          string query1 = " Insert into Employee_company_info (E_ID,Department, Post, Duty_shift, Date_Hired, Date_Released) values ("+ID+",'" + comboBoxDepartment.Text + "','" + comboBoxPost.Text + "','" + comboBoxDutyShift.Text + "','" + dateTimePicker1.Value + "','" + dateTimePicker2.Value + "') ";
  
          dbcon.commandExecuteNonQuery(query1);
          MessageBox.Show("data inserted sucessfully");
  
  
      }
      catch (Exception exp)
      {
          MessageBox.Show(exp.Message);
          MessageBox.Show("data not inserted ");
  
      }
  }
  </code></pre>
  
  <p>thanks in advance.</p>