Click here to Skip to main content
11,414,234 members (71,495 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: SQL-server-2005 C#
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 9-Oct-12 0:26am
Edited 9-Oct-12 0:49am
Tell us what have you tried so that we can suggest some new solutions for you...
snehasish nandy at 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 at 9-Oct-12 5:52am
you need to write a function with reqex to do like statement task.
snehasish nandy at 9-Oct-12 5:53am
please give me some example how to do this
Kschuler at 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 at 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
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.

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 9,130
1 OriginalGriff 7,477
2 Maciej Los 3,710
3 Abhinav S 3,298
4 Peter Leow 3,084

Advertise | Privacy | Mobile
Web01 | 2.8.150427.2 | Last Updated 9 Oct 2012
Copyright © CodeProject, 1999-2015
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