Solved

Country & Region Tables MS SQL

Posted on 2008-10-07
5
1,204 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
  • 4
5 Comments
 
LVL 14

Expert Comment

by:dfu23
Comment Utility
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
Comment Utility
0
 
LVL 14

Expert Comment

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

Author Comment

by:pr_wainwright
Comment Utility
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
Comment Utility
so something like,

COUNTRIES
 - COUNTRY_ID (Primary Key)
 - COUNTRY_NAME

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

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now