且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何根据选择从下拉列表中获取地区,州和国家?

更新时间:2022-10-19 14:48:31

您需要在数据库中为国家/地区创建不同的表格, States Districts

从这些表中提取数据并填充 DropDownLists



用户选择所有 DropDownList 并提交数据后,您需要获取每个 DropDownList 的SelectedValues 并根据这些值制定 SQL查询



然后在 ADO.NET 对象的帮助下执行 SQL查询



就是这样。 :)

in my project i have to save user address details based on their selection of districts and states and countries how can i have these all country,state,districts in my application? help me out
Thanks in advance

You need to create different Tables in your Database for Countries, States and Districts.
Pull data from those tables and populate the DropDownLists.

After user selects all the DropDownList and Submits the data, you need to get the SelectedValues of each DropDownList and formulate a SQL Query based on those values.

Then execute the SQL Query with the help of ADO.NET Objects.

That's it. :)