Using this code you can convert arraylist to array of its native type.. Its very easy and simple. Below is the way to convet ArrayList to Array
In C# code sample
ArrayList arrList= new ArrayList();
int []arrToConvert = new int[]{};
//Add some value to ArrayList of type integer
arrList.Add(1);
arrList.Add(2);
arrList.Add(3);
arrList.Add(4);
//Now convert ArrayList to array
arrToConvert = (int[])arrList.ToArray(typeof(Int32));In the above example we have taken Integer value and stored in the array list so while conversion we have to convert of array type of integer
Vb.Net sample code
Dim arrList As New ArrayList()
Dim arrToConvert As Integer() = New Integer() {}
'Add some value to ArrayList
arrList.Add(1)
arrList.Add(2)
arrList.Add(3)
arrList.Add(4)
'Now convert ArrayList to array
arrToConvert = DirectCast(arrList.ToArray(GetType(Int32)), Integer())Similarly you can convert any type of datatype to array like string, decimal, float double datatype or object
Cheers
Pankaj