【发布时间】:2013-09-03 11:45:12
【问题描述】:
我想从数据库中搜索值并从 databaseshow 中删除值。我可以搜索,但是当我单击删除按钮时,它给了我以下错误:
语法错误:'=' 后缺少操作数。
这是我的代码:
private void sID_textBox7_TextChanged_1(object sender, EventArgs e)
{
try
{
BindingSource bs = new BindingSource();
bs.DataSource = dataGridView4.DataSource;
bs.Filter = "[Product ID]=" + sID_textBox7.Text.ToString();
dataGridView1.DataSource = bs;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
【问题讨论】:
-
您的过滤器将类似于
Product ID = SomeText,这是不正确的。您需要像Product ID = 'SomeText'一样使用它
标签: c# winforms datagridview bindingsource