如何在C#中搜索所有数据库Fild? [英] How Do I Search In All Database Fild In C#?

查看:107
本文介绍了如何在C#中搜索所有数据库Fild?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好所有

i想要在所有tabel filde中搜索一个单词吗?

i使用来自access和c#语言...

hello all
i want search by a word in all tabel filde?
i use from access and c# language...

推荐答案

这假设它正在搜索单个表的所有字段。



SELECT * FROM

table

WHERE

column1 LIKE @keyword

OR

column2 LIKE @keyword

OR

...列出的所有列



如果您只想搜索,则必须在关键字末尾添加通用外卡从价值的开头或开始和结束(* +关键字+ *),如果你想在价值的任何地方搜索。



注意:我是从内存写入,通配符可能是访问的其他一些字符(就像它在SQL Server中的%)



如果这有帮助请花时间接受解决方案。谢谢。
This assumes it is searching through all fields of a single table.

SELECT * FROM
table
WHERE
column1 LIKE @keyword
OR
column2 LIKE @keyword
OR
...all columns listed

You'll have to add generic wild card at the end of the keyword if you want to search only from the start of the value or at the start and end ( * + keyword + * ) if you want to search anywhere in the value.

NOTE: I'm writing from memory, wildcard could be some other character for access (like it is % in SQL Server)

If this helps please take time to accept the solution. Thank you.


这篇关于如何在C#中搜索所有数据库Fild?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆