Click here to Skip to main content
15,908,909 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:
C#
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";
Posted
Updated 18-Oct-13 2:21am
v2
Comments
Harshil_Raval 18-Oct-13 8:02am    
hi, you are using sql query in rowfilter!!!!!!!!!
It's not possible my friend.
Update your sp instead.

Agree with Harshil_Raval, you can't use that way. Use LINQ with DataView.
Filtering with DataView (LINQ to DataSet)[^]
 
Share this answer
 
in place of " Top(5) jobId ".
You simply need to use " Top 5 jobId "
 
Share this answer
 
Comments
Harshil_Raval 18-Oct-13 8:41am    
Hi, are you sure that sql statement is allowed in dataview rowfilter?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900