private void CountTodayPatients() { FormListOfPatients frmListOfPatients = new FormListOfPatients(); var countTodayPatients = dbContext.GetTodayPatients(frmListOfPatients.dtpSearch.Value.Date.ToShortDateString()); foreach (var countToday in countTodayPatients) { count[0] = (int)countToday; } lblTodayPatients.Text = count[0].ToString(); }