MySQL 데이터베이스에 연결하고 결과를 나열하는 C# 응용 프로그램을 만들고 있습니다. 두 개의 텍스트 상자를 추가하여 두 텍스트 상자의 텍스트 변경 이벤트에 사용자 ID와 사용자 이름/성으로 데이터를 필터링 할 수있게해야합니다. 난 내 프로그램을 실행하고 내가 EvaluationException이 예외를 얻을 그 텍스트 상자 중 하나에 뭔가를 입력 할 때 코드는 그러나이C# MySQL 바인딩 소스가 평가 예외를 throw합니다.
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;
}
과 같습니다 : 난 단지 내가 전에 ID 텍스트 상자를 사용
The expression contains undefined function call CONCAT_WS().
이름/성을 추가하고 단지 students.uid LIKE '%" + this.tbSearchId.Text + @"%'
만 사용하면 정상적으로 작동합니다.
무슨 일입니까? LIKE
표현을 허용하지만 CONCAT
이나 CONCAT_WS
함수를 인식하지 못합니까?
감사! 'LIKE'는 저를 버렸습니다. 그리고 나는 어떻게 든 MySQL과 comunicating하고 있다고 생각했습니다. – MrPlow