private void InIHouse() { List <V_HouseSet> HouseEc = new List <V_HouseSet>(); DataTable dt = T_Sysset.GetHouseName(); if (dt == null || dt.Rows.Count <= 0) { return; } foreach (DataRow dr in dt.Rows) { V_HouseSet House = new V_HouseSet(); House.HouseID = Convert.ToInt32(dr["id"].ToString()); House.HouseName = dr["HOUSENAME"].ToString(); HouseEc.Add(House); } cBoxKf.Items.Clear(); cBoxKf.Items.AddRange(HouseEc.ToArray()); cBoxKf.SelectedItem = HouseEc; cBoxKf.SelectedIndex = 0; }