private void cbbDistrict_SelectedIndexChanged(object sender, EventArgs e) { string DistrictNametemp = cbbDistrict.SelectedItem.ToString(); string DistrictName = ""; if (DistrictNametemp.Contains("Thành Phố")) { DistrictName = DistrictNametemp.Substring(10); } if (DistrictNametemp.Contains("Huyện")) { DistrictName = DistrictNametemp.Substring(6); } if (DistrictNametemp.Contains("Quận")) { DistrictName = DistrictNametemp.Substring(5); } if (DistrictNametemp.Contains("Thị Xã")) { DistrictName = DistrictNametemp.Substring(7); } DataTable dt = SignUpController.IDDistrict_Find(DistrictName).Tables[0]; string IDTemp = dt.Rows[0][0].ToString(); int ID = int.Parse(IDTemp); DataTable Ward = SignUpController.Ward_Show(ID).Tables[0]; cbbWard.Items.Clear(); foreach (DataRow dr in Ward.Rows) { string temp = dr["WardName"].ToString(); cbbWard.Items.Add(temp); } }