gpt4 book ai didi

c# - 在 C#4.0 中使用 RowFilter 在 DataView 中过滤数字

转载 作者:行者123 更新时间:2023-11-30 15:04:31 24 4
gpt4 key购买 nike

我正在尝试使用 RowFilter 过滤我的 DataView 数据集。

我想在整数列上执行 like 语句

所以像这样:

myDataView.RowFilter ="ID LIKE %1%";

这适用于字符串列,但我在尝试使用整数时收到错误消息。我收到以下错误:无法对 System.Int32 和 System.Int32 执行“喜欢”操作。

无论如何对数字做一个 LIKE 语句?

提前致谢。

最佳答案

它对我有用:

"Convert(DataGridColumnName, 'System.String') LIKE '%" & txtBox.Text & "%' "

关于c# - 在 C#4.0 中使用 RowFilter 在 DataView 中过滤数字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10172156/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com