Click here to Skip to main content
15,949,741 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi! I am new to asp.net and I want to create a search box which can search even similar words.In my database there first name ,last name and location. When I typed "a" and submit then show all "a" include names and locations from database in data grid view.

Thanks for your precious time!
Posted
Comments
Thanks7872 21-Oct-13 5:15am    
And how much Precious time have you spent trying to implement this?
ridoy 21-Oct-13 6:32am    
that is called autocompleteness.

 
Share this answer
 
v2
Comments
Wailin tun 23-Oct-13 6:51am    
It's the best.
Take the search input into a variable and execute select query on click on Search button.
eg. String input ="abc"; // or TextBox1.Text

Your query will look like :
C#
String SqlQuery = "Select * from TableName where firstName like '%"+ input + "%' or lastName like '%"+ input + "%' or Location like '%"+ input + "%'";
 
Share this answer
 
Comments
Wailin tun 23-Oct-13 6:50am    
Now you fill up my code,thanks!
http://www.aspdotnet-suresh.com/2012/02/jquery-display-auto-complete-search.html[^]


remember one thing you need to learn some JQuery.this type of problems will be solved in very easy way with that.......
 
Share this answer
 
Comments
Wailin tun 23-Oct-13 6:49am    
Really thanks for your helps.It's complete now!

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