Click here to Skip to main content
15,889,527 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have a dropdownlist in my project with city name i want that when i write first alphabate of city then all the cities whose name is start with that alphabate are show in series i dropdown list so what i do??
please give me c# code for this
Posted

Hi
Select the city name from database using order by cityname
 
Share this answer
 
please give me c# code for this
It does not work like this here.

Here is what is expected of enquirers:
1. TRY first what you want to do! You may find that it's not that hard.
2. Formulate what was done by you that looks like an issue/not working.

Try them and tell if you face issues.
Members will be more than happy to help like this.


For now, since you have not mentioned winforms or web, will not share any link. Here is the logic:
Winforms: Have a combobox with autocomplete property true such that typing start characters show all the possible names.
Web: Having the functionality client side would make sense and give better useability. So, place a textbox, define a onkeypress for it and then using AJAX, get the data related to it from server, bind and show in a div below textbox (to show it as a dropdown). You can use ASP.NET AJAX extender too for it. Other option is to have jQuery autocomplete plugin.

Now, go ahead, try out and then post specific issue if you face.
 
Share this answer
 
Comments
Ritu khatri 2-Jul-12 3:10am    
k... i understand

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