pr_wainwright
asked on
Country & Region Tables MS SQL
Hi,
I wish to have a web form with 2 DropDownList boxes. The first DropDownList box should be linked to a table of countries & the second linked to a table of regions. When a country is selected in DropDownList box 1 only the applicable regions for that country should appear in list box 2. How do I create the tables/relationships & form to achieve this?.
Thanks
Paul.
I wish to have a web form with 2 DropDownList boxes. The first DropDownList box should be linked to a table of countries & the second linked to a table of regions. When a country is selected in DropDownList box 1 only the applicable regions for that country should appear in list box 2. How do I create the tables/relationships & form to achieve this?.
Thanks
Paul.
You could marry this data up with the ISO standard as well:
http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm
http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm
From this data you just need to setup some SqlDataSources accordingly to populate your dropdowns ...
ASKER
dfu23,
I need to know how to create my own 2 tables & relationships so that I can setup the dropdowns to display only regions applicable to the selected country.
e.g.
CountryTable -
CountryID
CountryName
RegionTable -
RegionID
RegionName
+Some link to Country table so only applicable regions show when dropdown country selected.
If i put 3 countries in the country table
UK
USA
India
& some regions in the region table
Boston
New York
London
Manchester
Mumbai
Goa
Then select USA in dropdownlist box 1 then only Boston & New York should appear in dropdownlist box 2
Thanks
Paul.
I need to know how to create my own 2 tables & relationships so that I can setup the dropdowns to display only regions applicable to the selected country.
e.g.
CountryTable -
CountryID
CountryName
RegionTable -
RegionID
RegionName
+Some link to Country table so only applicable regions show when dropdown country selected.
If i put 3 countries in the country table
UK
USA
India
& some regions in the region table
Boston
New York
London
Manchester
Mumbai
Goa
Then select USA in dropdownlist box 1 then only Boston & New York should appear in dropdownlist box 2
Thanks
Paul.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://unstats.un.org/unsd/methods/m49/m49regin.htm