Filter an integer using Like in BindingSoure.Filter or DataView.RowFilter

蹲街弑〆低调 提交于 2019-12-02 02:14:55

Consider these notes:

  • You've put the column name between '' which makes it as a string literal.

  • Use [] around column name if it's a complex name.

  • To compare an integer column with LIKE operator, you should first convert it to string because LIKE is an string operator.

  • Also make sure your column name is Courier # and it's not the caption/header text.

Example

dataView.RowFilter = "Convert([Some Column], System.String) LIKE '12%'";

More Information

To learn more about supported syntax for filter, take a look at DataColumn.Expression.

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