.NET BindingSource Filter syntax reference

℡╲_俬逩灬. 提交于 2019-12-05 03:44:15

The syntax is generally the same as what would you would use in a SQL Where clause, without the "Where", so in this case, it would be

  bindingSource.Filter = "Field <> NULL";

If you look at msdn docs for BindingSource.Filter you will see this:

"To form a filter value, specify the name of a column followed by an operator and a value to filter on. The accepted filter syntax depends on the underlying data source. If the underlying data source is a DataSet, DataTable, or DataView, you can specify Boolean expressions using the syntax documented for the DataColumn..::.Expression property."

Follow that link to see all the detailed rules

Have a look at this msdn article. The described syntax should be valid for your BindingSource, too.

What worked for me was

bindingSource.Filter = "columnName Is Null";

or conversely

bindingSource.Filter = "columnName Is Not Null";
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!