Solved

Country & Region Tables MS SQL

Posted on 2008-10-07
5
1,222 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 97 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

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
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.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

688 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