Там в `textBox8_TextChanged` пропущено в начале `%`. Д.б. так:
private void textBox8_TextChanged(object sender, EventArgs e)
{
if (comboBox1.Text == "number")
{
SqlConnection po = new SqlConnection("Data Source=max;Initial Catalog=lr;Integrated Security=True");
SqlDataAdapter sda = new SqlDataAdapter("SELECT number,name,city, data FROM people WHERE number like '%" + textBox8.Text + "%' ", po);
DataTable dt = new DataTable();
sda.Fill(dt);
dataGridView1.DataSource = dt;
}
else if (comboBox1.Text == "data")
{
SqlConnection po = new SqlConnection("Data Source=max;Initial Catalog=lr;Integrated Security=True");
SqlDataAdapter sda = new SqlDataAdapter("SELECT number,name,city, data FROM people WHERE data like '%" + textBox8.Text + "%'", po);
DataTable dt = new DataTable();
sda.Fill(dt);
dataGridView1.DataSource = dt;
}
}
ЗЫ. Надеюсь это на 1-2 дня код, а не в продакшн. Много зависимостей и др.