• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1233
  • Last Modified:

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.
0
pr_wainwright
Asked:
pr_wainwright
  • 4
1 Solution
 
dfu23Commented:
Why not use what a large organization has already set as a 'standard' ... like the United Nations, for example:

http://unstats.un.org/unsd/methods/m49/m49regin.htm
0
 
dfu23Commented:
0
 
dfu23Commented:
From this data you just need to setup some SqlDataSources accordingly to populate your dropdowns ...
0
 
pr_wainwrightAuthor Commented:
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.

0
 
dfu23Commented:
so something like,

COUNTRIES
 - COUNTRY_ID (Primary Key)
 - COUNTRY_NAME

REGIONS
 - REGION_ID (Primary Key)
 - REGION_NAME
 - COUNTRY_ID (Foreign Key)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now