Marto

Marto

  • NA
  • 8
  • 0

A bug in Arraylist ????

Jun 20 2008 9:46 AM

I have tried to make the following array dynamic but ran into a 'problem'. The datatable below has 4  items.

    int[] refNos = new int[100];

  for (int i = 0; i < newTable2.Rows.Count; i++)
           {
             refNos[i] = System.Convert.ToInt32(newTable2.Rows[i][1]);
        }

When I display refNos[i] I get all items, however if I use an array list instead I get 3 items. The last item is not displayed ?

 ArrayList refNos  = new ArrayList();

  for (int i = 0; i < newTable2.Rows.Count; i++)
           {
           refNos1.Add(System.Convert.ToInt32(newTable2.Rows[i][1]));
        }

This does not display the last item. Why ?
 I would really like to make this dynamic but I can't get through ?

Answers (2)