数据表';后缺少操作数;卡车总重';操作人员
本文关键字:操作 数据表 操作数 卡车 | 更新日期: 2023-09-27 18:27:40
我有一个数据表,要在其中分配选择查询。但弹出以下错误:"语法错误:'TruckGrossWeight'运算符后缺少操作数。"
DataRow[] drs = dataTableForDropDowns
.Select("LNGFuelAvailability=" + drpdwnlst_LNGFuelAvailability.SelectedValue + " " +
"TruckGrossWeight=" + drpdwnlst_TruckGrossCombinedWeight.SelectedValue + "");
所选值的值(int)为:
drpdwnlst_LNGFuelAvailability.SelectedValue= 5
drpdwnlst_TruckGrossCombinedWeight.SelectedValue = 2
尝试低于
DataRow[] drs = dataTableForDropDowns.Select("LNGFuelAvailability = "+drpdwnlst_LNGFuelAvailability.SelectedValue+ " AND TruckGrossWeight = "+drpdwnlst_TruckGrossCombinedWeight.SelectedValue);
语法应该如下
DataRow[] results = table.Select("A = foo AND B = bar");
或
DataRow[] results = table.Select("A = foo OR B = bar");