2013-04-20 2 views
2

다음 웹 서비스를 통해 모든 국가가 제공됩니다. 나는 모든 주와 지방을 얻고 싶다. 어떻게해야합니까?.NET에서 주 및도 구

http://ws.geonames.org/countryInfo

유일한 방법은 여기 API 사용자 이름 http://www.geonames.org/export/web-services.html에 등록하고 COUNTRY_CODE 나는 각 나라 통해 반복에 의해 채울 것이다 변수입니다 http://api.geonames.org/postalCodeSearch?country=COUNTRY_CODE&username=demo처럼 뭔가 전화를 만들려고하는 것 같다.

모든 주/지방 정보를보다 쉽고/편리하게 얻을 수있는 방법이 있습니까? http://ws.geonames.org/stateInfo 같은 것이 환상적 일 것입니다!

+1

의견이없는 downvote ... 나가 이것을 바보 같은 질문하게 만드는 나가 잃어버린 무언가가있는 경우에, 저에게하십시오. – user1477388

답변

1

나는이 것을 알았다 최고 :

CREATE TABLE `countries` (
    `id` smallint(5) unsigned NOT NULL auto_increment, 
    `name` varchar(40) NOT NULL, 
    `abbreviation` varchar(4) NOT NULL, 
    PRIMARY KEY (`id`) 
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; 

CREATE TABLE `states` (
    `id` smallint(5) unsigned NOT NULL auto_increment, 
    `country_id` smallint(5) unsigned NOT NULL, 
    `name` varchar(100) NOT NULL, 
    `abbreviation` varchar(3) NOT NULL, 
    PRIMARY KEY (`id`) 
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; 

INSERT INTO countries (name, abbreviation) VALUES ('Canada', 'CAN'); 
INSERT INTO countries (name, abbreviation) VALUES ('United States of America', 'USA'); 

INSERT INTO states (country_id, name, abbreviation) VALUES ('1', 'Alberta', 'AB'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('1', 'British Columbia', 'BC'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('1', 'Manitoba', 'MB'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('1', 'New Brunswick', 'NB'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('1', 'Newfoundland and Labrador', 'NL'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('1', 'Northwest Territories', 'NT'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('1', 'Nova Scotia', 'NS'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('1', 'Nunavut', 'NU'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('1', 'Ontario', 'ON'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('1', 'Prince Edward Island', 'PE'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('1', 'Québec', 'QC'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('1', 'Saskatchewan', 'SK'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('1', 'Yukon Territory', 'YT'); 


INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Alaska', 'AK'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Alabama', 'AL'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Arizona', 'AZ'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Arkansas', 'AR'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'California', 'CA'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Colorado', 'CO'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Connecticut', 'CT'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Delaware', 'DE'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'District of Columbia', 'DC'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Florida', 'FL'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Georgia', 'GA'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Hawaii', 'HI'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Idaho', 'ID'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Illinois', 'IL'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Indiana', 'IN'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Iowa', 'IA'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Kansas', 'KS'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Kentucky', 'KY'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Louisiana', 'LA'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Maine', 'ME'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Maryland', 'MD'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Massachusetts', 'MA'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Michigan', 'MI'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Minnesota', 'MN'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Mississippi', 'MS'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Missouri', 'MO'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Montana', 'MT'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Nebraska', 'NE'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Nevada', 'NV'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'New Hampshire', 'NH'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'New Jersey', 'NJ'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'New Mexico', 'NM'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'New York', 'NY'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'North Carolina', 'NC'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'North Dakota', 'ND'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Ohio', 'OH'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Oklahoma', 'OK'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Oregon', 'OR'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Pennsylvania', 'PA'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Puerto Rico', 'PR'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Rhode Island', 'RI'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'South Carolina', 'SC'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'South Dakota', 'SD'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Tennessee', 'TN'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Texas', 'TX'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Utah', 'UT'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Vermont', 'VT'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Virginia', 'VA'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Washington', 'WA'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'West Virginia', 'WV'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Wisconsin', 'WI'); 
INSERT INTO states (country_id, name, abbreviation) VALUES ('2', 'Wyoming', 'WY'); 

내가 여기에서 가져온 어떤이 http://www.prioninteractive.com/2011/02/mysql-sql-for-generating-canada-and-usa-provincestate-tables/

이 일반적인 것 등이다; 나는 그것을 찾기가 너무 어려웠다는 것을 믿을 수 없다 ...

희망이 다른 누군가를 도울 것입니다.