步步为营-40-省市列表二级联动
说明: ComboBox的使用
1:准备数据
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
USE [master] GO /****** Object: Database [DBProvinceCity] Script Date: 2017-04-27 09:27:48 ******/ CREATE DATABASE [DBProvinceCity] CONTAINMENT = NONE ON PRIMARY ( NAME = N'DBProvinceCity', FILENAME = N'F:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA\DBProvinceCity.mdf' , SIZE = 4288KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ) LOG ON ( NAME = N'DBProvinceCity_log', FILENAME = N'F:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA\DBProvinceCity_log.ldf' , SIZE = 1072KB , MAXSIZE = 2048GB , FILEGROWTH = 10%) GO ALTER DATABASE [DBProvinceCity] SET COMPATIBILITY_LEVEL = 120 GO IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled')) begin EXEC [DBProvinceCity].[dbo].[sp_fulltext_database] @action = 'enable' end GO ALTER DATABASE [DBProvinceCity] SET ANSI_NULL_DEFAULT OFF GO ALTER DATABASE [DBProvinceCity] SET ANSI_NULLS OFF GO ALTER DATABASE [DBProvinceCity] SET ANSI_PADDING OFF GO ALTER DATABASE [DBProvinceCity] SET ANSI_WARNINGS OFF GO ALTER DATABASE [DBProvinceCity] SET ARITHABORT OFF GO ALTER DATABASE [DBProvinceCity] SET AUTO_CLOSE OFF GO ALTER DATABASE [DBProvinceCity] SET AUTO_SHRINK OFF GO ALTER DATABASE [DBProvinceCity] SET AUTO_UPDATE_STATISTICS ON GO ALTER DATABASE [DBProvinceCity] SET CURSOR_CLOSE_ON_COMMIT OFF GO ALTER DATABASE [DBProvinceCity] SET CURSOR_DEFAULT GLOBAL GO ALTER DATABASE [DBProvinceCity] SET CONCAT_NULL_YIELDS_NULL OFF GO ALTER DATABASE [DBProvinceCity] SET NUMERIC_ROUNDABORT OFF GO ALTER DATABASE [DBProvinceCity] SET QUOTED_IDENTIFIER OFF GO ALTER DATABASE [DBProvinceCity] SET RECURSIVE_TRIGGERS OFF GO ALTER DATABASE [DBProvinceCity] SET ENABLE_BROKER GO ALTER DATABASE [DBProvinceCity] SET AUTO_UPDATE_STATISTICS_ASYNC OFF GO ALTER DATABASE [DBProvinceCity] SET DATE_CORRELATION_OPTIMIZATION OFF GO ALTER DATABASE [DBProvinceCity] SET TRUSTWORTHY OFF GO ALTER DATABASE [DBProvinceCity] SET ALLOW_SNAPSHOT_ISOLATION OFF GO ALTER DATABASE [DBProvinceCity] SET PARAMETERIZATION SIMPLE GO ALTER DATABASE [DBProvinceCity] SET READ_COMMITTED_SNAPSHOT OFF GO ALTER DATABASE [DBProvinceCity] SET HONOR_BROKER_PRIORITY OFF GO ALTER DATABASE [DBProvinceCity] SET RECOVERY FULL GO ALTER DATABASE [DBProvinceCity] SET MULTI_USER GO ALTER DATABASE [DBProvinceCity] SET PAGE_VERIFY CHECKSUM GO ALTER DATABASE [DBProvinceCity] SET DB_CHAINING OFF GO ALTER DATABASE [DBProvinceCity] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF ) GO ALTER DATABASE [DBProvinceCity] SET TARGET_RECOVERY_TIME = 0 SECONDS GO ALTER DATABASE [DBProvinceCity] SET DELAYED_DURABILITY = DISABLED GO EXEC sys.sp_db_vardecimal_storage_format N'DBProvinceCity', N'ON' GO USE [DBProvinceCity] GO /****** Object: Table [dbo].[city] Script Date: 2017-04-27 09:27:48 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[city]( [cityID] [int] NOT NULL, [cityName] [varchar](50) NOT NULL, [proID] [int] NULL, PRIMARY KEY CLUSTERED ( [cityName] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO /****** Object: Table [dbo].[Province] Script Date: 2017-04-27 09:27:48 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Province]( [proID] [int] NOT NULL, [proName] [varchar](50) NOT NULL, PRIMARY KEY CLUSTERED ( [proID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (19, N'阿坝藏族羌族自治州', 22) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (8, N'阿克苏市', 32) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'阿拉尔市', 32) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (12, N'阿拉善盟', 33) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (22, N'阿勒泰市', 32) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'阿里地区', 30) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (12, N'阿图什市', 32) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (9, N'安康市', 28) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (8, N'安庆市', 13) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'安顺市', 24) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'安阳市', 17) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'鞍山市', 8) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'澳门特别行政区', 34) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (8, N'巴彦淖尔市', 33) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (17, N'巴中市', 22) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (8, N'白城市', 9) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (13, N'白沙黎族自治县', 25) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'白山市', 9) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'白银市', 21) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (10, N'百色市', 29) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'蚌埠市', 13) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'包头市', 33) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'宝鸡市', 28) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'保定市', 5) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'保山市', 26) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (17, N'保亭黎族苗族自治县', 25) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'北海市', 29) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'北京市', 1) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'本溪市', 8) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'毕节地区', 24) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (16, N'滨州市', 16) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (15, N'亳州市', 13) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (17, N'博乐市', 32) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (9, N'沧州市', 5) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'昌都地区', 30) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (14, N'昌吉市 ', 32) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (14, N'昌江黎族自治县', 25) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'长春市', 9) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'长沙市', 19) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'长治市', 6) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'常德市', 19) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'常州市', 11) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (13, N'巢湖市', 13) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (13, N'朝阳市', 8) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (19, N'潮州市', 20) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (10, N'郴州市', 19) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'成都市', 22) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (8, N'承德市', 5) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (9, N'澄迈县', 25) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (16, N'池州市', 13) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'赤峰市', 33) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (14, N'崇左市', 29) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (10, N'滁州市', 13) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (12, N'楚雄彝族自治州', 26) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (15, N'达州市', 22) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'大 庆 市', 10) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (13, N'大理白族自治州', 26) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'大连市', 8) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'大同市', 6) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (13, N'大兴安岭地区', 10) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'丹东市', 8) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'儋州市', 25) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (14, N'德宏傣族景颇族自治州', 26) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'德阳市', 22) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (14, N'德州市', 16) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (16, N'迪庆藏族自治州', 26) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (10, N'定安县', 25) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (11, N'定西市', 21) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (8, N'东方市', 25) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (17, N'东莞市', 20) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'东营市', 16) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'鄂尔多斯市', 33) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'鄂州市', 18) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (17, N'恩施土家族苗族自治州', 18) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'防城港市', 29) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'佛山市', 20) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'福州市', 14) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'抚顺市', 8) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (10, N'抚州市', 15) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (15, N'阜康市', 32) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (9, N'阜新市', 8) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (11, N'阜阳市', 13) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (14, N'甘南藏族自治州', 21) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (20, N'甘孜藏族自治州', 22) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'赣州市', 15) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'高雄市', 7) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (19, N'高雄县', 7) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'固原市', 31) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (14, N'广安市', 22) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'广元市', 22) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'广州市', 20) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (8, N'贵港市', 29) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'贵阳市', 24) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'桂林市', 29) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'果洛藏族自治州', 27) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'哈尔滨市', 10) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (10, N'哈密市', 32) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'海北藏族自治州', 27) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'海东地区', 27) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'海口市', 25) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'海南藏族自治州', 27) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (8, N'海西蒙古族藏族自治州', 27) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'邯郸市', 5) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'汉中市', 28) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'杭州市', 12) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'合肥市', 13) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (11, N'和田市', 32) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (12, N'河池市', 29) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (14, N'河源市', 20) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (17, N'菏泽市', 16) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (11, N'贺州市', 29) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'鹤 岗 市', 10) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'鹤壁市', 17) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (11, N'黑 河 市', 10) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (11, N'衡水市', 5) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'衡阳市', 19) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (10, N'红河哈尼族彝族自治州', 26) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'呼和浩特市', 33) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'呼伦贝尔市', 33) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'湖州市', 12) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (14, N'葫芦岛市', 8) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (23, N'花莲县', 7) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (12, N'怀化市', 19) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (8, N'淮安市', 11) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'淮北市', 13) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'淮南市', 13) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (10, N'黄冈市', 18) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'黄南藏族自治州', 27) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (9, N'黄山市', 13) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'黄石市', 18) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (11, N'惠州市', 20) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'鸡 西 市', 10) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'基隆市', 7) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (8, N'吉安市', 15) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'吉林市', 9) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'济南市', 16) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (8, N'济宁市', 16) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (18, N'济源市', 17) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (9, N'佳木斯市', 10) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'嘉兴市', 12) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'嘉义市', 7) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (17, N'嘉义县', 7) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'嘉峪关市', 21) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'江门市', 20) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (8, N'焦作市', 17) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (20, N'揭阳市', 20) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'金昌市', 21) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'金华市', 12) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'锦州市', 8) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'晋城市', 6) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'晋中市', 6) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (8, N'荆门市', 18) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'荆州市', 18) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'景德镇市', 15) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'九江市', 15) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (9, N'酒泉市', 21) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (9, N'喀什市', 32) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'开封市', 17) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'克拉玛依市', 32) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (13, N'库尔勒市', 32) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (19, N'奎屯市', 32) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'昆明市', 26) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'拉萨市', 30) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (13, N'来宾市', 29) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (12, N'莱芜市', 16) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'兰州市', 21) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (10, N'廊坊市', 5) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (15, N'乐东黎族自治县', 25) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (10, N'乐山市', 22) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'丽江市', 26) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (11, N'丽水市', 12) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'连云港市', 11) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (21, N'凉山彝族自治州', 22) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (10, N'辽阳市', 8) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'辽源市', 9) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (15, N'聊城市', 16) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'林芝地区', 30) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (8, N'临沧市', 26) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (10, N'临汾市', 6) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (12, N'临高县', 25) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (13, N'临夏回族自治州', 21) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (13, N'临沂市', 16) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (16, N'陵水黎族自治县', 25) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'柳州市', 29) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (14, N'六安市', 13) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'六盘水市', 24) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (8, N'龙岩市', 14) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (12, N'陇南市', 21) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (13, N'娄底市', 19) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'泸州市', 22) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (11, N'吕梁市', 6) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'洛阳市', 17) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (11, N'漯河市', 17) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'马鞍山市', 13) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (9, N'茂名市', 20) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (12, N'眉山市', 22) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (12, N'梅州市', 20) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (16, N'米泉市', 32) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'绵阳市', 22) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (12, N'苗栗县', 7) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (8, N'牡丹江市', 10) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (9, N'内江市', 22) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'那曲地区', 30) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'南昌市', 15) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (11, N'南充市', 22) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'南京市', 11) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'南宁市', 29) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'南平市', 14) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'南通市', 11) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (15, N'南投县', 7) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (13, N'南阳市', 17) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'宁波市', 12) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (9, N'宁德市', 14) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (15, N'怒江傈傈族自治州', 26) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'攀枝花市', 22) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (11, N'盘锦市', 8) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (21, N'澎湖县', 7) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'平顶山市', 17) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (8, N'平凉市', 21) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (20, N'屏东县', 7) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'萍乡市', 15) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'莆田市', 14) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (9, N'濮阳市', 17) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (10, N'七台河市', 10) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'齐齐哈尔市', 10) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (15, N'潜江市', 18) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (8, N'黔东南苗族侗族自治州', 24) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (9, N'黔南布依族苗族自治州', 24) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'黔西南布依族苗族自治州', 24) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'钦州市', 29) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'秦皇岛市', 5) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'青岛市', 16) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (16, N'清远市', 20) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (10, N'庆阳市', 21) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'琼海市', 25) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (18, N'琼中黎族苗族自治县', 25) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'曲靖市', 26) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (8, N'衢州市', 12) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'泉州市', 14) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'日喀则地区', 30) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (11, N'日照市', 16) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (12, N'三门峡市', 17) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'三明市', 14) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'三亚市', 25) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'山南地区', 30) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'汕头市', 20) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (13, N'汕尾市', 20) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (10, N'商洛市', 28) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (14, N'商丘市', 17) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'上海市', 3) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (11, N'上饶市', 15) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'韶关市', 20) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'邵阳市', 19) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'绍兴市', 12) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'深圳市', 20) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (16, N'神农架林区', 18) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'沈阳市', 8) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'十堰市', 18) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'石河子市 ', 32) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'石家庄市', 5) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'石嘴山市', 31) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'双鸭山市', 10) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'朔州市', 6) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'思茅市', 26) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'四平市', 9) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'松原市', 9) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'苏州市', 11) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (13, N'宿迁市', 11) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (12, N'宿州市', 13) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (12, N'绥 化 市', 10) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (12, N'随州市', 18) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (8, N'遂宁市', 22) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (20, N'塔城市', 32) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'台北市', 7) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (8, N'台北县', 7) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (22, N'台东县', 7) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'台南市', 7) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (18, N'台南县', 7) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'台中市', 7) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (13, N'台中县', 7) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (10, N'台州市', 12) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'太原市', 6) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (9, N'泰安市', 16) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (12, N'泰州市', 11) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'唐山市', 5) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (10, N'桃园县', 7) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'天津市', 2) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (14, N'天门市', 18) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'天水市', 21) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (12, N'铁岭市', 8) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'通化市', 9) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'通辽市', 33) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'铜川市', 28) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'铜陵市', 13) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'铜仁地区', 24) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'图木舒克市', 32) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'吐鲁番市', 32) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (11, N'屯昌县', 25) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'万宁市', 25) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (10, N'威海市', 16) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'潍坊市', 16) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'渭南市', 28) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'温州市', 12) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'文昌市', 25) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (9, N'文山壮族苗族自治州', 26) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'乌海市', 33) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (9, N'乌兰察布市', 33) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'乌鲁木齐市', 32) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (21, N'乌苏市', 32) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'无锡市', 11) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'吴忠市', 31) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'芜湖市', 13) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'梧州市', 29) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'五家渠市', 32) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'五指山市', 25) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'武汉市', 18) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'武威市', 21) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'西安市', 28) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'西宁市', 27) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (11, N'西双版纳傣族自治州', 26) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (10, N'锡林郭勒盟', 33) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'厦门市', 14) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (13, N'仙桃市', 18) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (11, N'咸宁市', 18) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'咸阳市', 28) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'香港特别行政区', 35) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'湘潭市', 19) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (14, N'湘西土家族苗族自治州', 19) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'襄樊市', 18) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (9, N'孝感市', 18) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (9, N'忻州市', 6) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'新乡市', 17) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'新余市', 15) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'新竹市', 7) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (11, N'新竹县', 7) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (15, N'信阳市', 17) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (11, N'兴安盟', 33) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'邢台市', 5) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'徐州市', 11) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (10, N'许昌市', 17) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (17, N'宣城市', 13) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (16, N'雅安市', 22) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'烟台市', 16) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'延安市', 28) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (9, N'延边朝鲜族自治州', 9) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (9, N'盐城市', 11) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (10, N'扬州市', 11) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (15, N'阳江市', 20) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'阳泉市', 6) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'伊 春 市', 10) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (18, N'伊宁市', 32) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (13, N'宜宾市', 22) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'宜昌市', 18) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (9, N'宜春市', 15) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (9, N'宜兰县', 7) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (9, N'益阳市', 19) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'银川市', 31) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'鹰潭市', 15) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (8, N'营口市', 8) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (11, N'永州市', 19) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (8, N'榆林市', 28) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (9, N'玉林市', 29) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'玉树藏族自治州', 27) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'玉溪市', 26) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'岳阳市', 19) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (21, N'云浮市', 20) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (16, N'云林县', 7) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (8, N'运城市', 6) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (4, N'枣庄市', 16) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (8, N'湛江市', 20) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (8, N'张家界市', 19) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'张家口市', 5) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (7, N'张掖市', 21) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (14, N'彰化县', 7) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (6, N'漳州市', 14) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'昭通市', 26) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (10, N'肇庆市', 20) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (11, N'镇江市', 11) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'郑州市', 17) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (18, N'中山市', 20) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (5, N'中卫市', 31) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (1, N'重庆市', 4) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (9, N'舟山市', 12) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (16, N'周口市', 17) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'株洲市', 19) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'珠海市', 20) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (17, N'驻马店市', 17) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (18, N'资阳市', 22) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'淄博市', 16) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (2, N'自贡市', 22) GO INSERT [dbo].[city] ([cityID], [cityName], [proID]) VALUES (3, N'遵义市', 24) GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (1, N'北京市') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (2, N'天津市') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (3, N'上海市') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (4, N'重庆市') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (5, N'河北省') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (6, N'山西省') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (7, N'台湾省') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (8, N'辽宁省') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (9, N'吉林省') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (10, N'黑龙江省') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (11, N'江苏省') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (12, N'浙江省') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (13, N'安徽省') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (14, N'福建省') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (15, N'江西省') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (16, N'山东省') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (17, N'河南省') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (18, N'湖北省') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (19, N'湖南省') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (20, N'广东省') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (21, N'甘肃省') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (22, N'四川省') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (24, N'贵州省') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (25, N'海南省') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (26, N'云南省') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (27, N'青海省') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (28, N'陕西省') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (29, N'广西壮族自治区') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (30, N'西藏自治区') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (31, N'宁夏回族自治区') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (32, N'新疆维吾尔自治区') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (33, N'内蒙古自治区') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (34, N'澳门特别行政区') GO INSERT [dbo].[Province] ([proID], [proName]) VALUES (35, N'香港特别行政区') GO ALTER TABLE [dbo].[city] WITH CHECK ADD FOREIGN KEY([proID]) REFERENCES [dbo].[Province] ([proID]) GO USE [master] GO ALTER DATABASE [DBProvinceCity] SET READ_WRITE GO
2: 设置省,然后添加一个Province类,然后重写ToString方法(返回市名属性)比较好,这里为了省事直接通过字典保存数据
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
using System; using System.Collections.Generic; using System.ComponentModel; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace Province_City { public partial class Form1 : Form { public Form1() { InitializeComponent(); } //定义一个字典--省;存放显示的名称和int值 private Dictionary<string, string> provinceList = new Dictionary<string, string>(); private void Form1_Load(object sender, EventArgs e) { string sqlSelect = "select proID, proName from Province"; MakeList(sqlSelect, "Province"); this.cbProvince.SelectedIndex = 0; } private void cbProvince_SelectedIndexChanged(object sender, EventArgs e) { //01获取选择省的名称 string proviceName =Convert.ToString(this.cbProvince.SelectedItem); //02 通过名称查询字典获取ID string proviceID = provinceList[proviceName]; //03 根据省份ID获取省下的市 string sqlSelect = "select cityID, cityName, proID from city where proID =" + proviceID; //04调用之前先清空 this.cbCity.Items.Clear(); MakeList(sqlSelect, "city"); } public void MakeList( string sqlSelect,string flag) { //01创建连接字符串 //01-a 配置config文件 //01-b 添加引用 string connStr = ConfigurationManager.ConnectionStrings["connStr"].ConnectionString; //02创建连接对象 SqlConnection conn = new SqlConnection(connStr); using (conn) { //03打开数据 conn.Open(); //04接受SQL脚本, using (SqlCommand cmd = new SqlCommand(sqlSelect, conn)) { //05执行脚本 using (cmd) { //06使用SqlDataReader读取数据 using (SqlDataReader reader = cmd.ExecuteReader()) { if (flag == "Province") { while (reader.Read()) { //把省的信息放到 ComboBox中。ComboBox显示信息是 Item对象的ToString() //同时把id值放到对应的字典中,也可以新建一个Province类进行存储 this.cbProvince.Items.Add(reader["proName"].ToString()); provinceList.Add(reader["proName"].ToString(), reader["proID"].ToString()); } } else { while (reader.Read()) { this.cbCity.Items.Add(reader["cityName"].ToString()); } } } } } } } } }
3:运行效果