01.
Public
Sub
combobox_province()
02.
03.
Dim
txt
As
String
04.
Dim
adapter
As
New
SqlClient.SqlDataAdapter
05.
Dim
ds
As
DataSet =
New
DataSet
06.
txt =
"SELECT * FROM db_province order by pro_id asc"
07.
08.
adapter.SelectCommand =
New
SqlClient.SqlCommand(txt, cn)
09.
adapter.Fill(ds)
10.
combo_province.DataSource = ds.Tables(0)
11.
combo_province.ValueMember =
"pro_id"
12.
combo_province.DisplayMember =
"pro_name"
13.
End
Sub
14.
Public
Sub
combobox_aumphor()
15.
Dim
txt
As
String
16.
Dim
adapter
As
New
SqlClient.SqlDataAdapter
17.
Dim
ds
As
DataSet =
New
DataSet
18.
txt =
"SELECT * FROM db_aumphor where pro_id = '"
& combo_province.SelectedValue.ToString() &
"' order by aum_id asc"
19.
20.
adapter.SelectCommand =
New
SqlClient.SqlCommand(txt, cn)
21.
adapter.Fill(ds)
22.
combo_aumphor.DataSource = ds.Tables(0)
23.
combo_aumphor.ValueMember =
"aum_id"
24.
combo_aumphor.DisplayMember =
"aum_name"
25.
End
Sub
26.
Public
Sub
combobox_tumbon()
27.
Dim
txt
As
String
28.
Dim
adapter
As
New
SqlClient.SqlDataAdapter
29.
Dim
ds
As
DataSet =
New
DataSet
30.
txt =
"SELECT * FROM db_tumbon where aum_id = '"
& combo_aumphor.SelectedValue.ToString() &
"' order by tum_id asc"
31.
adapter.SelectCommand =
New
SqlClient.SqlCommand(txt, cn)
32.
adapter.Fill(ds)
33.
combo_tumbon.DataSource = ds.Tables(0)
34.
combo_tumbon.ValueMember =
"tum_id"
35.
combo_tumbon.DisplayMember =
"tum_name"
36.
End
Sub
37.
Private
Sub
combobox_zippost()
38.
Dim
txt
As
String
39.
Dim
adapter1
As
New
SqlClient.SqlDataAdapter
40.
Dim
ds
As
DataSet =
New
DataSet
41.
txt =
"SELECT * FROM db_tumbon where tum_id = '"
& combo_tumbon.SelectedValue.ToString() &
"' order by tum_id asc"
42.
adapter1.SelectCommand =
New
SqlClient.SqlCommand(txt, cn)
43.
adapter1.Fill(ds)
44.
cust_zipcode.DataSource = ds.Tables(0)
45.
cust_zipcode.ValueMember =
"tum_id"
46.
cust_zipcode.DisplayMember =
"zippost_code"
47.
End
Sub