【发布时间】:2014-03-07 01:58:14
【问题描述】:
我正在使用向导等创建一个基于 c# 表单的应用程序,该应用程序使用数据库进行存储等。
我有一个客户表单,目前列出了数据网格中的所有记录。
private void frm_customer_Load(object sender, EventArgs e)
{
this.tbl_customerTableAdapter.Fill(this.myDataSet.tbl_customer);
}
我希望过滤记录。
在阅读了一些其他主题后,我发现可以使用 Select 方法来过滤我的 TableAdapter。到目前为止,我已将以下内容附加到按钮上。
string qString = "cust_postcode = CF48 4JY";
string oString = "cust_postcode DESC";
myDataSet.tbl_customer.Select(qString, oString);
当我点击按钮时,它会引发以下错误;
“语法错误:'4' 运算符后缺少操作数。”
我知道问题与 qString 本身有关,但我似乎找不到正确的查询方法。
有什么想法吗?
【问题讨论】:
-
我已经编辑了你的标题。请参阅“Should questions include “tags” in their titles?”,其中的共识是“不,他们不应该”。
标签: c# winforms tableadapter