winforms - ms access - like 关键字在 winform 中不起作用
问题描述
下面是我的查询,如果我删除了类似的条件,它工作正常,甚至等于也工作,但是当我给 Like 时它不起作用。请告诉我我在这里做错了什么
select ID,CustomerName from Master where CustomerName='Something' // This is working or records found
select ID,CustomerName from Master where CustomerName Like '*Something*' // This is not working or no records found
我在 winform 中使用 OleDb
解决方案
MS Access 使用 Jet-SQL 方言,您的查询将在其中工作,并且当您使用它的提供程序时
select ID,CustomerName from Master where CustomerName Like '*Something*'
您使用 OleDB 提供程序,并且需要在搜索模式中使用其语法、%
方法*
和_
方法来查找运算符?
LIKE
select ID,CustomerName from Master where CustomerName Like '%Something%'
推荐阅读
- javascript - 如何在 JavaScript 中循环数组内的多个对象
- android - Android Studio 中我的清单文件中 Appodeal 包的许多“未解决的类”
- python - python日期时间格式混乱
- jquery - 来自中心的 jQuery 动画
- c# - ASP.NET MVC DB 对象转换错误
- matlab - 基于整数值将矩阵拆分为单独的二进制矩阵 - matlab
- java - 为什么java jdk transferSize只有8k?
- powershell - 工作流程在 foreach 并行中的长工作流程调用上返回不可预测的结果
- apache-kafka - 错误:分区 0 没有领导者。跳过获取偏移量
- python - 如何在python中反转星号三角形