Your problem is in the followin line
For serial = 0 To count
Should be
For serial = 0 To count -1
--- In VisualBasic_Official@yahoogroups.com, "mary369_99" <honeypot4u@...>
wrote:
>
> Greetings
>
> I have to generate box, bundle and serial numbers as identifiers for a Store
Room System. I tried using an arraylist but got an error that:
> "Index was out of range. Must be non-negative and less than the size of the
collection. Parameter name: index"
>
> I am using 3 loops (box, bundle and serial) and want to store the values in
the arraylist. My code is as follows:
>
> Dim box, bundle, serial, count As Integer
>
> Dim SerialNum As New ArrayList(4)
>
> count = CInt(TxtSerial.Text)
>
>
> For serial = 0 To count
> Do Until serial = count
> serial = serial + 1
> SerialNum(1).Add(box).ToString()
> SerialNum(2).add(bundle).ToString()
> SerialNum(3).add(serial).ToString()
> GridView1.DataSource = SerialNum
> GridView1.DataBind()
> ' For batch = 1 To 80
> 'For box = 1 To count / 400
> 'Next
> ' Next
> Loop
> Next
>
> I get an error on this line:
> SerialNum(1).Add(box).ToString()
>
> A box must hold 500 serials. 100 forms in the box will have the same batch
number. Serial will be unique for every form
>
> Please assist.
>
> Regards
>