private void FillTaskNameDropDown() { DbTransaction dbTransaction = new DbTransaction(); allTasksList = dbTransaction.GetAllTasksForPeriod(DateTime.Now.ToString("yyyy-MM-dd"), DateTime.Now.AddDays(1).ToString("yyyy-MM-dd")); if (allTasksList.Count > 0) { this.taskNameComboBox.Items.Clear(); this.taskNameComboBox.Items.AddRange(allTasksList.Where(x => x.TaskName != "").Select(x => x.TaskName).Distinct().ToArray()); } }