Re: Outofmemoryexception
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:1184955893.264471.47110@i38g2000prf.googlegroups.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.
>
Date:Sun, 22 Jul 2007 17:21:25 +0300
Author:
|