开发者

Comma Separated check in asp.net

开发者 https://www.devze.com 2023-01-01 08:58 出处:网络
How to search every word separated by comma in textbox Please refer above post Its Working perfectly...But i have small issues.. when i enter in text box like c,c++,4-5 yrs it have to check in d开发者

How to search every word separated by comma in textbox Please refer above post

Its Working perfectly...But i have small issues.. when i enter in text box like c,c++,4-5 yrs it have to check in d开发者_运维知识库atabase like either c,c++ skills and 4-5 yrs experiecne and then the reult has to be shown... Burt as per ur query it just show results whether any one of keyword satisfy database ...I want to compare year also how? –


If you want that behavior, you have to program that behavior. One design is to have multiple input boxes: one where you check if any of the words exist, another where you check that all of the words exist. (Perhaps even another for an exact phrase match.) Another design possibility would be for you to develop a syntax to indicate optional and required words all within a single input box. The point is it is up to you.

After you've decided on a design, then you could write code that builds your query based on or matches on the optional words and and matches on the required. Something like this pseudocode

Select * From Table Where 
(Field Like OptionalWord1 Or Field Like OptionalWord2 Or Field Like OptionalWord3)
And Field Like RequiredWord1
And Field Like RequiredWord2
(etc.)
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号