Net-informations.com

ASP.NET ArrayList

ArrayList contains a simple list of values and very easily we can add , insert , delete , view etc. The capacity of a ArrayList is the number of elements the ArrayList can hold. As elements are added to an ArrayList, the capacity is automatically increased as required through reallocation.The capacity can be decreased by calling TrimToSize or by setting the Capacity property explicitly.

The ArrayList collection accepts Nothing as a valid value, allows duplicate elements. It is very flexible becuse we can add without any size information , that is it grow dynamically and also shrink .

VB.Net

C#

We can insert items in an ArrayList with a specified index

VB.Net

C#

For removing items from an ArrayList , we can use ArrayList.Remove(object)

VB.Net

C#

An ArrayList can also be sorted alphabetically or numerically with the Sort() method.

VB.Net

C#

The following ASP.NET program add seven days in a week to an ArrayList and bind it to a ListBox control.

Default.aspx



Click the following links to see full source code

C# Source Code
VB.NET Source Code
Default.aspx.cs
Default.aspx.vb





net-informations.com (C) 2019    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.
SiteMap  | Terms  | About