I have found that the best way to represent two-dimensional table
structures in .NET is to use either a 2-D array or a DataTable.
Collections, even of the Generics kind (although many of them provide
indexers for easy access) just do not map correctly to a table
structure.

On Apr 9, 8:27 pm, Jason Cavett <[email protected]> wrote:
> I am currently representing a table in C# via a two dimensional array
> - String[,] myArray = new String[20,4];
>
> I was wondering if there was a better way to represent tables in C#.
> The above solution may not be good enough if the table size changes of
> the file I am parsing (currently has 20 rows).  I would like to use
> C#'s Collections, but I also like the ease of being able to access a
> location in the two dimensional array by calling myArray[0,0] (rather
> than being forced to go through an iterator as C#'s collections seem
> to want to do).
>
> Does C# provide anything like this?
>
> Thank you.

Reply via email to