Click here to Skip to main content
15,881,089 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi, We are familiar with forms that prompt for our geographic location such as Country,state,City. when the country is selected , the states and cities in that particular location are listed in dropdown lists. I need such a list in my project. Can anyone know how to do it with the sqldatasource? I am working with Visual web developer 2008 and the code in C#.
Posted
Comments
bbirajdar 23-Aug-12 6:24am    
Yes. I know how to do it..

 
Share this answer
 
Comments
Member 8057382 23-Aug-12 11:52am    
This is what I exactly wanted. Thank you so much. It was of Great help to me. Thank you again.
Anuja Pawar Indore 24-Aug-12 0:57am    
WC :)
This is one possible site to look at:

http://www.dbtutorials.com/advanced/populatingdropdown-csharp.aspx[^]

But there are also hundres of other sites that explain this! Maybe you dont know Google yet. So i'll shortly explain it. Go to www.google.com (this is a search engine by the way). There you can enter keywords which should be searched for. For example try: "asp.net dropdownlist database" and press Enter! Like magic a lot of search results will show up which may help you in your research. Good luck and please pass this information on to your friends.
 
Share this answer
 
Comments
Member 8057382 23-Aug-12 6:39am    
Thanks.My question is about how to populate the second list based on the input selected from the first list.For ex, If the choosen entry from the 1st List is India then all the states in India must be populated in second list. how to work it out in an easier way?
Member 8057382 23-Aug-12 6:43am    
Using a field Named "Level" in the table, I easily listed all the countries in my 1st List using the Sqldatasource. For the second List, The problem is, I have to compare the level and also the Input that is selected at the run time in the 1st List. I dont Know how to do this in sqldatasource!
Legor 23-Aug-12 7:10am    
See the answer by Anuja which shows some tutorials on this task.

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