注册。使用两列的数据表过滤器 [英] Reg. Datat Table Filter Using Two Columns

查看:66
本文介绍了注册。使用两列的数据表过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含以下值的数据表:

I have a data table containing the following values :

NAME    OLD_ID     NEW_ID

A         12         12
B         23         19
C         56         48



我想过滤上面的数据表 OLD_ID!= NEW_ID



目前我已编写过滤语句如下:


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

Currently I have written the filter statement as follows:

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?

推荐答案

尝试如下...

Try like below...
DataRow[] rows = null
rows = dt.Select("OLD_ID <> NEW_ID")


尝试 rows = dt.Select(OLD_ID<> NEW_ID)

仅供参考 .NET DataTable Select Expersions [ ^ ]


这篇关于注册。使用两列的数据表过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆