title: Cannot update Access Database DataGridView
body: <p>I'm trying to somehow <strong>update</strong> or <strong>retrieve</strong> again data from Access database (<a href="https://i.stack.imgur.com/8O6Cd.png" rel="nofollow noreferrer">Random piece of data with column names</a>)</p>
  <p>I'm using <code>Microsoft.ACE.OLEDB.12.0</code>.</p>
  <p>I created a query which should return records where a Column has a value between two dates:</p>
  <p><strong>SQL</strong> example:</p>
  <pre><code>SELECT Arkusz1.ID, Arkusz1.Adres, Arkusz1.Umówione, Arkusz1.Data_umówienia, Arkusz1.Zakończone, Arkusz1.[Spisano?], Arkusz1.Notatki  
  FROM Arkusz1 
  WHERE( 
       ((Arkusz1.Umówione) = Yes) // or 1 or &lt;&gt; 0
   AND ((Arkusz1.Zakończone) = No)  // or 0 doesen't provide right answer
   AND ((Arkusz1.Data_umówienia) BETWEEN 24/07/2021 AND 26/07/2021) ) 
   ORDER BY Arkusz1.Data_umówienia;
  </code></pre>
  <p>My code:</p>
  <pre><code>void fillGrid()
  {
      string teraz = DateTime.Today.AddDays(-1).ToShortDateString().Replace('.', '/');
      string jutro = DateTime.Today.AddDays(1).ToShortDateString().Replace('.', '/');
      // AddDays +-1 because of my data issue, that's not important
  
      string dzisiejsze = &quot;SELECT Arkusz1.ID, Arkusz1.Adres, Arkusz1.Umówione, Arkusz1.Data_umówienia,&quot; 
          + &quot; Arkusz1.Zakończone, Arkusz1.[Spisano?], Arkusz1.Notatki  FROM Arkusz1&quot; 
          + &quot; WHERE( ((Arkusz1.Umówione) = Yes) AND ((Arkusz1.Zakończone) = No) AND &quot; 
          + &quot;((Arkusz1.Data_umówienia) BETWEEN &quot;
          + teraz + &quot; AND &quot; + jutro + &quot;) )&quot; 
          + &quot; ORDER BY Arkusz1.Data_umówienia;&quot;;
          //selecting almost every column from my only sheet (Arkusz1), 
          //if Umówione (appointment is arranged) has True value AND issue is not ended (Zakończone) 
          //AND appointment date is between yesterday and tomorrow 
          //(as I said, that's all because my stupid ideas in creating DB)
  
      connection.Open();
  
      OleDbDataAdapter dataAdapter = new OleDbDataAdapter(dzisiejsze, connection);
      DataTable dt = new DataTable();
      dataAdapter.Fill(dt);
      TodaysPlan_dataGridView.DataSource = dt;
      TodaysPlan_dataGridView.Refresh();
  
      connection.Close();
  }
  </code></pre>
  <p>I even added a special button to update the whole grid (firstly it was supposed to update after a second Form is closed):</p>
  <pre><code>private void refreshGrid_Click(object sender, EventArgs e)
  {
      Application.DoEvents(); // because I saw something on stack, didn't work
      fillGrid(); //start filling again, didn't work too
      TodaysPlan_dataGridView.Refresh(); // same, didn't work
  }
  </code></pre>
  <p>I don't get any error, execution (even in debug-mode) just passes by the code in <code>refreshGrid_Click</code>.</p>
  <p><a href="https://i.stack.imgur.com/Qm9jz.png" rel="nofollow noreferrer">Edit: Tried to execute that SQL code for random data, didn't work too</a>
  Ofc that's not the most important part of my question but I could ask that in addition :)</p>
  <p>I'll also provide code for <em>saving button from second form</em>, but in my opinion it won't be really helpful:</p>
  <pre><code>private void save_button_Click(object sender, EventArgs e)
  {
      if ((Tick_label.Visible == true) &amp;&amp; (IDInfo_label.Text == &quot;All good!&quot;) &amp;&amp; (street_textBox.TextLength &gt; 0))
      {
          connection.Open();
          string cmd_string = &quot;INSERT INTO Arkusz1 (ID, Adres, Przydzielenie) VALUES ('&quot; + ID_maskedTextBox.Text + &quot;', '&quot; + street_textBox.Text + &quot;','&quot; + startDate_dateTimePicker.Value + &quot;')&quot;;
          OleDbCommand command = new OleDbCommand(cmd_string, connection);
          command.ExecuteNonQuery();
          connection.Close();
  
          this.DialogResult = DialogResult.OK;
          this.Close();
      }
      else
      {
          MessageBox.Show(&quot;error&quot;);
      }
  }
  </code></pre>
  <p>That's my first question on Stack, any suggestions and constructive criticism are welcome!</p>
  <p>BTW, I was using <a href="https://www.youtube.com/watch?v=B5EpbmcGmAY" rel="nofollow noreferrer">this YT</a> tutorial, hope it helps someone :)</p>