I'm making an application in C# which connects to an MySQL database and lists the results. I've added two text boxes which should allow users to filter the data by user id and user name/surname on textchanged events for both textboxes. The code looks like this
private void tbSearchStudents_TextChanged(object sender, EventArgs e)
{
BindingSource binding = new BindingSource();
binding.DataSource = dataGridViewStudents.DataSource;
this.tsProgressBar.Visible = true;
this.tsProgressBar.Style = ProgressBarStyle.Marquee;
binding.Filter = @"students.uid LIKE '%" + this.tbSearchId.Text + @"%'
AND CONCAT_WS(' ' , students.name, students.surname)
LIKE '%" + this.tbSearchName.Text + "%'";
this.dataGridViewStudents.DataSource = binding;
this.tsProgressBar.Visible = false;
}
However when i run my program and try to enter something in either of those textboxes i get an EvaluationException exception:
The expression contains undefined function call CONCAT_WS().
When i only used the id textbox before i added the name/surname one and used only students.uid LIKE '%" + this.tbSearchId.Text + @"%' everything worked fine.
What is going on? It accepts LIKE expression but it doesn't recognize CONCAT nor CONCAT_WS functions?