Click here to Skip to main content
Sign Up to vote bad
good
See more: SQL2005C#
Hi all
 
Please tell me how to code to search a full sentence in C# application..
e.g. "What is your name"-i want to search this
so if all words are present then it should return the same else if few words matches then that also it should return..
 
i m using sql-server 2005 and visual studio 2008
 
waiting for ur replies.
Thank you
Posted 8 Oct '12 - 23:26
Code-Hunt2.7K
Edited 8 Oct '12 - 23:49

Comments
Tell us what have you tried so that we can suggest some new solutions for you...
snehasish nandy - 9 Oct '12 - 5:44
i tried using like operator..but when i m putting the whole question then it is not working...
Mohd. Mukhtar - 9 Oct '12 - 5:52
you need to write a function with reqex to do like statement task.
snehasish nandy - 9 Oct '12 - 5:53
please give me some example how to do this
Kschuler - 9 Oct '12 - 16:28
It would help if you would provide a few examples of what you are searching, what you are searching for, and what result you are expecting.
geekbond - 9 Oct '12 - 7:44
To find a sentence, you can search for punctuations. All sentences end with either a fullstop('.'), a question mark('?') or an exclamation('!'). So, just perform a search usin regex or any other method you can think of.

1 solution

Write a stored procedure and in that stored procedure write 3 query as below
query1 = SELECT * FROM tableName WHERE cloumnName like RegExpForExactMatch; 
query2 = SELECT * FROM tableName WHERE cloumnName like RegExpForAllMatch; 
query3 = SELECT * FROM tableName WHERE cloumnName like RegExpForAnyMatch; 
And then execute the query with the union;
 
Hope this will help you.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 425
1 OriginalGriff 315
2 Slacker007 240
3 Aarti Meswania 210
4 Maciej Los 200
0 Sergey Alexandrovich Kryukov 8,953
1 OriginalGriff 7,134
2 CPallini 3,758
3 Rohan Leuva 3,036
4 Maciej Los 2,488


Advertise | Privacy | Mobile
Web01 | 2.6.130516.1 | Last Updated 9 Oct 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid