?
Solved

Country & Region Tables MS SQL

Posted on 2008-10-07
5
Medium Priority
?
1,224 Views
Last Modified: 2012-05-05
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
Comment
Question by:pr_wainwright
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 14

Expert Comment

by:dfu23
ID: 22659303
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
 
LVL 14

Expert Comment

by:dfu23
ID: 22659308
0
 
LVL 14

Expert Comment

by:dfu23
ID: 22659317
From this data you just need to setup some SqlDataSources accordingly to populate your dropdowns ...
0
 
LVL 1

Author Comment

by:pr_wainwright
ID: 22659436
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
 
LVL 14

Accepted Solution

by:
dfu23 earned 388 total points
ID: 22659571
so something like,

COUNTRIES
 - COUNTRY_ID (Primary Key)
 - COUNTRY_NAME

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

Featured Post

Technology Partners: 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!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question