private void LoadCabinet() { try { if (Clsxtpz.myHouseID == 0) { return; } DataTable dt = T_Sysset.GetHouseGui(Clsxtpz.myHouseID); if (dt == null || dt.Rows.Count <= 0) { return; } this.lsvCabinet.Items.Clear(); int i = 1; foreach (DataRow dr in dt.Rows) { ListViewItem lvi = new ListViewItem(); lvi.Text = dr["HouseGui"].ToString(); lvi.SubItems.AddRange(new string[] { dr["HouseCol"].ToString(), dr["HouseRow"].ToString(), dr["HoseBoxCount"].ToString(), dr["HouseJuan"].ToString(), dr["ID"].ToString() }); this.lsvCabinet.Items.Add(lvi); i++; } } catch (Exception ee) { MessageBox.Show(ee.ToString()); } }