Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a data table containing the following values :
NAME    OLD_ID     NEW_ID

A         12         12
B         23         19
C         56         48

I want to filter above data table where the OLD_ID!=NEW_ID

Currently I have written the filter statement as follows:
C#
DataRow[] rows = null
rows = dt.Select("OLD_ID != NEW_ID")


and it is giving the error that
Cannot interpret token "!" at position 8


So anyone can tell that what is the wrong in the filter statement?
Posted
v2
Comments
Garth J Lancaster 4-Nov-13 0:18am    
what breed/brand of database are you connecting to ?

Try like below...
C#
DataRow[] rows = null
rows = dt.Select("OLD_ID <> NEW_ID")
 
Share this answer
 
Try rows = dt.Select("OLD_ID <> NEW_ID")
FYI .NET DataTable Select Experssions[^]
 
Share this answer
 

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