Alex Rivera | Logout

How do I create a multidimensional array list in c#?

Asked 2010-09-28T18:33:48.363
11

Is it possible to create a multidimensional arraylist in C#?

StartDate   Qty   size
9/1/2010    10     15
9/1/2009    12     17
9/1/2008    11     19

StartDate, Qty and size are the 3 arraylists. I need to have them in a single arraylist. I would also need to sort this arraylist by StartDate. Is this possible? Is there a better way to do it other than arraylist?

Edit
Report

1 Answer

1

If these properties describe an entity or "data row", you might consider creating a class:

public class MyClass
{
    public DateTime StartDate {get;set;}
    public int Qty {get;set;}
    public int Size {get;set;}
}

You can then create an array of these objects:

List<MyClass> myClassArray = new List<MyClass>();
answered 2010-09-28T18:37:21.737

Your Answer