WPF
DataTable Select 구문 오류: 'B' 연산자 뒤에 피연산자가 없습니다.
NicSub
2021. 4. 29. 19:39
728x90
반응형
DataTable Select 구문 오류: 'B' 연산자 뒤에 피연산자가 없습니다.
"log_mac = " + STR[2] ; << 에러.
SQL 처럼 조회 문자열에 '문자열' 처럼 ''을 추가 해줘야 한다.
string expression = "Log_Mac ='" + STR[2] +"'";
DataRow[] result = Result_Table.Select(expression);
if (result.Length > 0)
{
int SelectedIndex = Result_Table.Rows.IndexOf(result[0]);
SMS_Result_LBX.Items.RemoveAt(SelectedIndex);
}
반응형