Question: Using datagrid I am connected to sqlite. I am able to open the particular table for sqlite into data grid. But now I want to search particular thing from the table i am using the select statement and appltying a text box. User enters the input and serach from there. Below is my code

```
    private void button2_Click(object sender, EventArgs e)
    {
        SQLiteConnection connection2 = new SQLiteConnection(@"Data Source = C:\ssds\WEBATM\APTRABuilder.sqlite;Version =3");
        connection2.Open();
        string sql2 = "Select *from builderScreenResourceBundleTBL where screenId like '%_textboxSearch%'";
        SQLiteDataAdapter connect2 = new SQLiteDataAdapter(sql2, connection2);
        DataSet ds2 = new DataSet();
        connect2.Fill(ds2);
        dataGridView.DataSource = ds2.Tables[0];
    }

```

So in the sql2 string statement how do i need to enter through text box?

Answer: 
Just do this

```
string sql2 = 
"Select * from builderScreenResourceBundleTBL where screenId like '%"+YourTextBox.Text+"%'";

```
You can use yogi's answer above or you can directly apply a filter on your DataGridView, which would look something like this:

```
private void textBox1_TextChanged(object sender, EventArgs e)
    {
        try
        {
            ((DataTable)dataGridView1.DataSource).DefaultView.RowFilter = string.Format("screenId like '%{0}%'", textBox1.Text.Trim().Replace("'", "''"));
        catch (Exception) { }

    }

```