VB.NET arrays

Hello,
Advance thenaks. Am facing some isses in VB.NET array and am using SL4.0 .]

Dim arrayArray(36) As Array
dim locArray(36) As String

arrayArray(0) = locArray
arrayArray(1) = locArray
arrayArray(2) = locArray
arrayArray(3) = locArray
arrayArray(4) = locArray, etc….

 

Consider there is a button show 1 , show 2 , etc…each button click will bind respective array elements in arrayArray to the page controls. If I click show1, arrayarray(0) is bind to all the controls in the page.Similarly when I click Show2, arrayarray(1) is bind to all the controls in page….

How to delete the arrayarray(3) alone in case.
If I am deleting arrayArray(3), then I would like to bring the values in arrayarray(4) to  arrayarray(3), arrayarray(5) to arrayarray(4), arrayarray(6) to arrayarray(5), etc….

Similarly when I want to delete  arrayarray(4) alone in case.
If I am deleting arrayArray(4), then I would like to bring the values in arrayarray(5) to arrayarray(4), arrayarray(6) to arrayarray(5), arrayarray(7) to arrayarray(6),arrayarray(8) to arrayarray(7), arrayarray(9) to arrayarray(8),etc….



Kind regards,
Pooja
poojasureshkumarAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Jeff CertainConnect With a Mentor Commented:
The easiest way is to change from an array to a list. You can still refer to items by index, but removing items will display the behaviour you're looking for.

In addition, you gain type safety and some performance because you don't need to box/unbox your data.

Dim arrayList As New List(Of String())
Dim locArray(36) As String

arrayList.Add(locArray)
arrayList.Add(locArray)
' etc
0
 
poojasureshkumarAuthor Commented:
Thanks Chaosian.
0
 
poojasureshkumarAuthor Commented:
Thanks for fast response
0
 
Jeff CertainCommented:
Glad I could help.
0
All Courses

From novice to tech pro — start learning today.