private void loadPartDataToComboBox(ComboBox cb) { DataTable dt = PartDAO.GetAllData(); cb.DataSource = dt; cb.DisplayMember = "PartName"; cb.ValueMember = "PartID"; }
private void loadPartDataWithFieldAllToComboBox(ComboBox cb) { DataTable dt = PartDAO.GetAllData(); DataRow dr = dt.NewRow(); dr["PartName"] = "Tất cả"; dt.Rows.InsertAt(dr, 0); cb.DataSource = dt; cb.DisplayMember = "PartName"; cb.ValueMember = "PartID"; }
/* * Part data */ private void loadPartList() { dgvPartList.DataSource = PartDAO.GetAllData(); }