如何根据选择从下拉列表中获取地区,州和国家? [英] how to get districts and states and countries from drop down list based on selection?
本文介绍了如何根据选择从下拉列表中获取地区,州和国家?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的项目中,我必须根据他们选择的地区,州和国家来保存用户地址详细信息如何在我的应用程序中拥有这些所有国家,州,地区?帮助我
提前致谢
解决方案
您需要在数据库中为国家/地区创建不同的表格, States 和 Districts 。
从这些表中提取数据并填充DropDownLists
。
用户选择所有DropDownList
并提交数据后,您需要获取每个
并根据这些值制定 SQL查询。DropDownList
的SelectedValues
然后在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 theDropDownLists
.
After user selects all theDropDownList
and Submits the data, you need to get theSelectedValues
of eachDropDownList
and formulate a SQL Query based on those values.
Then execute the SQL Query with the help ofADO.NET
Objects.
That's it. :)
这篇关于如何根据选择从下拉列表中获取地区,州和国家?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文