I have a class (students) with say 2 strings and an int array
A second class then does this:
List<student> myS = new List<student>();
All of this works correctly and I have a list containing multiple students. I am however having difficulty accessing the values within the int[].
So, my student list is populated from a database and into a list.
I then have a generic class which has a parameter List which I then want as a data table. The generic class will be called for the student class, subjects class and other classes - some of which may contain arrays and some which do not.
If I debug and step through, I get the following: (() myS.stu[6].termMark[1] and the value is 50. However if I enter int d =stu[6].termMark[1] the error is T does not contain a definition for termMark and no extension method 'termMark' accepting a first argument of type T could be found.
int d = myS[0][1] returns the error
cannot apply indexing with [] to an expression of type 'T'
. I have tried various things like creating a separate list and adding it to myS. Nothing works.
Thanks in advance for the help.
I am fairly new to this and probably missing the obvious...