这让我发疯!
我有一个数据表,让我们称之为
tbl
,我想根据我在其他地方的一些规则来选择行,例如
col_a > 'H00' and col_a < 'HZZ
和
col_b > '0000000000000' and col_b < 'ZZZZZZZZZZZZZ'
和
col_b like '%0__'
这给了我这样的表达:
dim expression as string = "( col_a > 'H00' and col_a < 'HZZ ) and ( col_b > '0000000000000' and col_b < 'ZZZZZZZZZZZZZ' ) and col_b like '%0__'"
前两个工作完美,但是当我引入“like”时返回零行。
Dim foundfaults As DataRow()
foundfaults = baseTable.Select(expression)
如果我只使用
dim expression as string = "( col_a > 'H00' and col_a < 'HZZ ) and ( col_b > '0000000000000' and col_b < 'ZZZZZZZZZZZZZ' )
我会选择数据,但如果我包含“like”,则行数为零。
为什么不喜欢“喜欢”?
@jmcilhinne 对问题的评估是正确的。我误解了他的第一篇文章,这对我不利。
Like
不适用于“_”作为通配符。