title: Filter and search DataGridView connected to a MS Access database in C#
body: <p>I use this code to filter and search a <code>DataGridView</code> connected to a MS Access database in C#, but when I enter anything into the textbox, every row of data in the <code>DataGridView</code>  disappears - any help?</p>
  
  <p>This code to appear in datagridview </p>
  
  <pre><code>    connection.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\AMR\Desktop\ABBagain-Copy.accdb;
  Persist Security Info=False;";
                  connection.Open();
                  OleDbCommand command = new OleDbCommand();
                  command.Connection = connection;
                  string query = "select * from Query1";
  
                  command.CommandText = query;
                  OleDbDataAdapter da = new OleDbDataAdapter(command);
                  DataTable dt;
                  dt = new DataTable();
                  da.Fill(dt);
                  dataGridView1.DataSource = dt;
                  da.Fill(dscontects);
                  connection.Close();
  </code></pre>
  
  <p>and this in textbox</p>
  
  <pre><code>DataView dv = new DataView(dt);
          dv.RowFilter = string.Format("SerialNumber LIKE '%{0}%'",textBox1.Text);
          table1DataGridView.DataSource = dv;
  </code></pre>