private void HighlightExistedFiscalYears() { StoredProcedures sp = new StoredProcedures(); DataSet fiscalYears = sp.GetExistedFiscalYears(); for (int i = 0; i < YearDropDownList.Items.Count; i++) { foreach (DataRow row2 in fiscalYears.Tables[0].Rows) { String fiscalYear = row2[0].ToString(); if (fiscalYear.Substring(fiscalYear.Length - 4) == YearDropDownList.Items[i].Value.ToString()) { YearDropDownList.Items[i].Attributes.Add("style", "color: silver"); } } } }