title: Search Access Database with C#.NET
body: <p>I have a simple code that can search fields in an access database.
  Now I need to change it to this parameters:</p>
  <ol>
  <li><p>Search a query in all fields in one textbox something like:</p>
  <p><code>&quot;select * from Sheet where * like@*&quot;</code></p>
  </li>
  <li><p>Show the results in labels instead GridView.</p>
  </li>
  </ol>
  <p>I make an oleDbCommand and connect it to an oleDbConnection and my oleDbConnection is:</p>
  <p><strong>Provider=Microsoft.ACE.OLEDB.12.0;Data Source=F:\Database.accdb</strong></p>
  <p>I use of Visual C# 2010 and an .accdb Access database.
  This is my code:</p>
  <pre><code>private void btnSearch_Click(object sender, EventArgs e)
  { 
      DataSet DSOne = new DataSet();
      OleDbDataAdapter adpSearch = new OleDbDataAdapter();
      adpSearch.SelectCommand = new OleDbCommand();
      adpSearch.SelectCommand.Connection = oleDbConnection1;
      adpSearch.SelectCommand.CommandText = &quot; select * from Sheet where OfficeNumber  like@OfficeNumber &quot;;
      adpSearch.SelectCommand.Parameters.AddWithValue(&quot;@OfficeNumber&quot;, textBox1.Text + &quot;%&quot;);
      adpSearch.Fill(DSOne, &quot;toop&quot;);
      dataGridView.DataSource = DSOne;
      dataGridView.DataMember = &quot;toop&quot;;
  }
      
  </code></pre>
  <p>Best Regards</p>