VB.NET arrays

Posted on 2011-04-26
Last Modified: 2013-11-12
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,
Question by:poojasureshkumar
    LVL 24

    Accepted Solution

    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

    ' etc

    Author Comment

    Thanks Chaosian.

    Author Closing Comment

    Thanks for fast response
    LVL 24

    Expert Comment

    by:Jeff Certain
    Glad I could help.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Suggested Solutions

    After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
    Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now