B
brandonjack007
I am using Arraylist to populate a drop down
I get outofmemoryexception at this line
for (iYear = 0; iYear <= oYearsList.Count - 1; iYear++)
{
sHtml.Append("<option value='" + oYearsList.Add(iYear)
+ "'>" + oYearsList.Add(iYear) + "</option>");
}
When I use:
for (iYear = 0; iYear <= oYearsList.Count - 1; iYear++)
{
sHtml.Append("<option value=2007>2007</option>");
}
I dont get this exception. Is there anything wrong the way I am using
the Add method of Arraylist.
I get outofmemoryexception at this line
for (iYear = 0; iYear <= oYearsList.Count - 1; iYear++)
{
sHtml.Append("<option value='" + oYearsList.Add(iYear)
+ "'>" + oYearsList.Add(iYear) + "</option>");
}
When I use:
for (iYear = 0; iYear <= oYearsList.Count - 1; iYear++)
{
sHtml.Append("<option value=2007>2007</option>");
}
I dont get this exception. Is there anything wrong the way I am using
the Add method of Arraylist.