C#DataTable.Select() - 我如何格式化筛选条件,包括空? [英] C# DataTable.Select() - How do I format the filter criteria to include null?
本文介绍了C#DataTable.Select() - 我如何格式化筛选条件,包括空?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这不工作
DataTable myNewTable = myDataTable.Select("Name <> 'n/a'").CopyToDataTable();
myDataTable有一个名为名行。我想选择从这个表中的行,其中名称不等于N / A。它选择,但仍然很想念我需要太空值的空值。
谁能帮助?
myDataTable has a row named "Name". I would like to select the rows from this table where Name is not equal to "n/a". It selects but still am missing the null values i need the null values too. Can anyone help?
推荐答案
试试这个
myDataTable.Select("[Name] is NULL OR [Name] <> 'n/a'" )
编辑:相关人士透露:
Relevant sources:
- DataTable.Select Method (String)
- Expression filtering syntax
这篇关于C#DataTable.Select() - 我如何格式化筛选条件,包括空?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文