[英]In .Net and c# DataTable.Select(string, string) method Question
What if we write filterExpression equal to null or "" ? 如果我们将filterExpression编写为null或“”怎么办? Will all the rows be selected?
是否会选择所有行?
Yes, I believe so. 是的,我相信。
In fact I more than believe so - having looked at Reflector (unfortunately the MSDN topic doesn't say anything about empty expressions) a filter is only applied if the expression is not empty or null. 实际上,我非常相信这一点-看了Reflector(不幸的是,MSDN主题没有说任何有关空表达式的内容),仅当表达式不为空或为null时才应用过滤器。
That said - why bother doing that? 就是说-为什么要这么做呢? Just iterate over the Rows or call the Select() method.
只需遍历Rows或调用Select()方法即可。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.