title: C# refresh DataGridView when updating or inserted on another form
body: <p>I have 2 forms which are <code>form A</code> and <code>form B</code>,</p>
  
  <p><code>form A</code> allowes user to insert and update student information.</p>
  
  <p><code>form b</code> is only a DataGridView and button there.</p>
  
  <p>When I insert student on <code>form A</code>, then I go to <code>form B</code>, the new student did not show on the DataGridView , and if I rerun the program, the new student will appear in <code>form B</code>.</p>
  
  <p>I tried using this on button on form b</p>
  
  <pre><code>datagridview1.refresh();
  datagridview1.update();
  </code></pre>
  
  <p>but it's still not working.</p>
  
  <hr>
  
  <p>Edited:</p>
  
  <p>My code for inserting a worker</p>
  
  <pre><code>cmd = new OleDbCommand("insert into FWINFOS (ID,Name,Gender,DateOfBirth,Race,WorkingPlace,PassportNO,DateOfExpire,[Position],Photo) values('" + textBox5.Text + "','" + textBox1.Text + "','" + textBox2.Text + "','" + dateTimePicker1.Value + "','" + textBox3.Text + "','" + textBox4.Text + "','" + textBox6.Text + "','" + dateTimePicker2.Value + "',@Position,@Photo)", con);
  
  
          cmd.Parameters.AddWithValue("@Position", comboBox1.SelectedText.ToString());
          conv_photo();
  
          con.Open();
          int n = cmd.ExecuteNonQuery();
          //cmd.ExecuteNonQuery();
          con.Close();
          if (n &gt; 0)
          {
              MessageBox.Show("Inserted");
              loaddata();
  
              rno++;
          }
          else
              MessageBox.Show("No Insert");
  
  
  
      }
  </code></pre>
  
  <p>my <code>Datagridview1(Form2)</code> doesn't automatically update when I inserted a new worker. But if I rerun the application, the new worker appears.</p>