Arrays are using for store similar data types grouping as a single unit. We can access Array elements by its numeric index. The array indexes start at zero.
The default value of numeric array elements are set to zero, and reference elements are set to null .vb.net
Dim arr(6) As String arr(0) = "Sunday"
arr(1) = "Monday"
string arr = new string; arr = "Sunday";
arr = "Monday";
The abovecode declare a string array of 7 strings and assign some values to it.
We can access the Arrays elements by providing its numerical index.
Dim str As String = arr(1)
string str = arr;
Above statement returns the second value from the Array.
The following ASP.NET program fill an arra with seven days in a week and bind it to a ListBox control.
Click the following links to see full source code