private void Load_cmbShift() { objDatabase Database = new objDatabase(); string strSQL = "Select Shift.Name from Shift"; SqlDataReader objReader; cmbShift.Items.Clear(); objReader = Database.ReturnData(strSQL); while (objReader.Read()) { cmbShift.Items.Add(objReader[0].ToString()); cmbShift.SelectedIndex = 0; } }
private void LoadControl() { objDatabase Database = new objDatabase(); SqlDataReader objReader; string strSQL = "Select Role.Description from Role"; objReader = Database.ReturnData(strSQL); while (objReader.Read()) { cmbRole.Items.Add(objReader[0].ToString()); } cmbRole.SelectedIndex = 0; txtFirstName.Focus(); }