-1

I want search a keyword from a Textbox in access file with C# and DataGridView, my code is below but has problem with error "Missing operand";

BindingSource bs = new BindingSource();
bs.DataSource = dataGridView1.DataSource;
bs.Filter = "select * FROM book WHERE onvan like '*" + textBox1.Text + "*'";
dataGridView1.DataSource = bs;
4

1 回答 1

-1

您不能将完整的选择查询作为bindingsource. 试试这个

bs.Filter = "onvan like '*" + textBox1.Text + "*'";

并查看此链接以获取更多信息:BindingSource.Filter

于 2013-08-29T22:43:59.273 回答