I\'d like to set up a multidimensional list. For reference, I am working on a playlist analyzer.
I have a file/file-list, which my program saves in a standard list.
You can also use DataTable - you can define then the number of columns and their types and then add rows http://www.dotnetperls.com/datatable
Well you certainly can use a List<List<string>>
where you'd then write:
List<string> track = new List<string>();
track.Add("2349");
track.Add("The Prime Time of Your Life");
// etc
matrix.Add(track);
But why would you do that instead of building your own class to represent a track, with Track ID, Name, Artist, Album, Play Count and Skip Count properties? Then just have a List<Track>
.
You can also..do in this way,
List<List<Object>> Parent=new List<List<Object>>();
List<Object> Child=new List<Object>();
child.Add(2349);
child.Add("Daft Punk");
child.Add("Human");
.
.
Parent.Add(child);
if you need another item(child), create a new instance of child,
Child=new List<Object>();
child.Add(2323);
child.Add("asds");
child.Add("jshds");
.
.
Parent.Add(child);