[求助]表达式包含无效的字符串常量!!
我想把符合条件的记录显示到DataGirdView控件上,代码是这么写得:
string strRowFilter = "";
string strCmb = this.comboBox1.Text.Trim();
if (this.TextBox1.Text.Trim() != "")
strRowFilter += "序号 like '%" + TextBox1.Text.Trim() + "%'and";
if (this.TextBox2.Trim() != "")
strRowFilter += "姓名 like '" + TextBox2.Text.Trim() + "' and";
if (strCmb != "")
strRowFilter += "籍贯 like '" + strCmb + "' and ";
if (strRowFilter != "")
strRowFilter = strRowFilter.Substring(0, strRowFilter.Length - 5);
tempTable.DefaultView.RowFilter = strRowFilter;
如果在序号的文本框里输入数字后,运行结果就提示说:表达式包含无效的字符串常量:“序号”
输入姓名和籍贯也是一样,请教一下 这是怎么回事呀?