Click here to Skip to main content
15,913,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to use dataview row filter in dropdownlist select index change.


For Example, Two dropdownList Box,Country and then City.if i select county(dropdownList) Like india and then Dipaly City(dropdownList) only list of indian
cites only.
Posted

1 solution

Loading all cities in DataTable and then filtering by the selected country is not efficient in terms of time and memory. Instead select only those cities from your database which are in the selected country. You can create a stored procedure that takes the CountryID as the input parameter and returns a table of the cities in that country. In your C# code, you can bind the stored procedure's output to your City Dropdown.
 
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