Click here to Skip to main content
15,901,666 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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
Updated 8-Oct-12 23:49pm
v3
Comments
bbirajdar 9-Oct-12 5:42am    
Tell us what have you tried so that we can suggest some new solutions for you...
[no name] 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.
[no name] 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.

1 solution

Write a stored procedure and in that stored procedure write 3 query as below
C#
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.
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900