You are adding items to the ArrayList while you loop through the same
arraylist. Sounds like infinite loop to me, right?
--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net
<> wrote in message
news: ups.com...
>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.
>