Hi VAer-4038,
You can search either FirstName or LastName with only one search textbox via following statement:
"select * from Name where FirstName like '" + txt_SearchName.Text+ "%' or LastName like '" + txt_SearchName.Text + "%'"
And for question about filtering DataGridView employees based on combo box value, you can refer to the code below:
private void comboBox1_SelectionChangeCommitted(object sender, EventArgs e)
{
(dataGridView1.DataSource as DataTable).DefaultView.RowFilter = string.Format("[Department] LIKE '%{0}%'", comboBox1.SelectedItem.ToString());
}
Best Regards,
Daniel Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.