Hi.You can refer to the following code.
public void Search()
{
using (OleDbConnection con = new OleDbConnection(constring))
{
con.Open();
OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT Firstname FROM students WHERE Firstname LIKE '% Hello %' ", con);
DataTable tb = new DataTable();
adapter.Fill(tb);
dataGridView1.DataSource = tb;
}
}
If you have any question,please contact me.