Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello programmers, got a few problems here. All I want is that when I type on ... let say example a textbox or a dropdown,letter "A", All data from the database with starting letter "A" will be post below like a suggestion.. Basically I want to create something like google search box but it will be based on my database. If the user type something new, it will be added to my database. Any tutorial regarding this matter Sir/Madams?


Thanks in advance..
Posted

What you want is called an auto complete text box and there are many examples if you search for it
 
Share this answer
 
Comments
janwel 16-Nov-11 21:57pm    
I think you I right sir now im reading articles on ajax tool kit hope you could help me on some debugs cause im new here
1. Bind the text box to a collection.
2. Load the collection with data from database on initialize.
3. On key press event, filter the collection with letter typed. You can use Link with collection, and use Find<> method which takes a predicate delegate.

Understanding Predicate Delegates in C#[^]
 
Share this answer
 
Comments
[no name] 16-Nov-11 21:30pm    
How do you think this would perform if the database contained 100s or 1000s of records?
The key event would require a post back on each character. How will this perform?
Basically, a very poor solution
anshudutta 16-Nov-11 22:25pm    
Use AJAX to handle post back. Thats what google does
[no name] 16-Nov-11 22:42pm    
Yes and how do think the auto complete text box works?

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