'top'运算符后缺少操作数 [英] Missing operand after 'top' operator
本文介绍了'top'运算符后缺少操作数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有问题过滤数据库提取的行。我使用dataview过滤行错误消息msg是:'top'运算符后缺少操作数
Plz给我任何解决方案。代码如下:
I have problem filtering the row that is fetch by the database.I filtering the row using dataview the error msg is: Missing operand after 'top' operator
Plz give me any solution. The code is below:
ds2 = con.FillDataSetWP("usp_AllTable");
DataView dv2 = new DataView();
dv2 = ds2.Tables[1].DefaultView;
dv2.RowFilter = "(SubCategoryId not in (12,11,13,15,17,37)) and JobId not in (select top(5)JobId from tblJob order by JobId desc) order by JobId desc";
推荐答案
同意Harshil_Raval,你不能用那种方式。使用LINQ和DataView。
使用DataView过滤(LINQ to DataSet) [ ^ ]
Agree with Harshil_Raval, you can't use that way. Use LINQ with DataView.
Filtering with DataView (LINQ to DataSet)[^]
代替Top(5)jobId。
你只需要使用Top 5 jobId
这篇关于'top'运算符后缺少操作数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文