Click here to Skip to main content
15,880,405 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

i need to display data in gridview that is fetched from database based on the question i type in a textbox. For example if my database contains Id,Name,Disease columns and if i want to retrieve the Id,name from Database based on disease say i will type in the textbox "get the Id,name of the patients having H1N1" it has to display all the records in gridview having H1N1.How to implement this ,i think here we need to compare the question "get the Id,name of the patients having H1N1" with disease and then display the result. Can you please let me know how to write the code for this using sql query,c# asp.net.

Thanks in advance
Posted
Comments
Kornfeld Eliyahu Peter 28-Apr-15 7:23am    
Check this: https://msdn.microsoft.com/en-us/library/ms142571.aspx

1 solution

I think you're underestimating the required effort to make something like this work. The only way to make this work with a reasonable amount of effort is to dictate a strict syntax the user has to obey when entering his query. Think something roughly like SQL just with more natural keywords. For that you would have to look into parsers, grammars and domain specific languages. But if you would want to allow the user to enter the query in whatever words he chooses then you would have to resort to natural language processing and it will get extremely complex.

So, my suggestion: Either stick with the traditional approach and let your users enter their search criteria not with sentences but with UI controls - or build a domain specific language. For that, I would suggest these tools:
http://goldparser.org/[^]
https://code.google.com/p/bsn-goldparser/[^]

You will find examples on those pages.
 
Share this answer
 

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