Whats the best way to create a multidimensional array

Posted on 2006-05-02
Last Modified: 2010-04-23
I want a 2D array that can store  2 numbers and a string eg: (2,'National',1.5) (256, 'Local',1.55)
Whats the best way of going about this...arraylists?
Question by:Milkus1
    LVL 85

    Accepted Solution

    You could write a Class to encapsulate your data and then store instances of that class in an ArrayList:

        Public Class Data
            Public myInt As Integer
            Public myStr As String
            Public myDbl As Double
        End Class

        Private myData As New ArrayList

        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim d As Data

            d = New Data
            d.myInt = 2
            d.myStr = "National"
            d.myDbl = 1.5

            d = New Data
            d.myInt = 256
            d.myStr = "Local"
            d.myDbl = 1.55

        End Sub

    Author Comment

    Yep works a treat, thanks

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
    Introduction When many people think of the WebBrowser ( control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    728 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

    16 Experts available now in Live!

    Get 1:1 Help Now