Click here to Skip to main content
12,503,591 members (54,697 online)
Rate this:
 
Please Sign up or sign in to vote.
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:26pm
Code-Hunt7.1K
Updated 8-Oct-12 23:49pm
v3
Comments
   
Tell us what have you tried so that we can suggest some new solutions for you...
snehasish nandy 9-Oct-12 5:44am
   
i tried using like operator..but when i m putting the whole question then it is not working...
Mohd. Mukhtar 9-Oct-12 5:52am
   
you need to write a function with reqex to do like statement task.
snehasish nandy 9-Oct-12 5:53am
   
please give me some example how to do this
Kschuler 9-Oct-12 16:28pm
   
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:44am
   
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

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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  
v2

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160919.1 | Last Updated 9 Oct 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100