Desktop Information System
I need help with my code as I get an error every time it tries to output the student data.
8 Replies
Here is the code
The delete option won't work properly either, it won't display any of the existing data
What's the error and where does it happen?
As a side note, writing
is just writing useless boilerplate code, it can be replaced by just
I am getting this error 'System.FormatException: 'Index (zero based) must be greater than or equal to zero and less than the size of the argument list.'
On this line
case Student student:
Console.WriteLine("{0,-10} {1,-15} {2,-10} {3,-15} {4,-20} {5,-10} {6,-8} {7,-8} {8,-5} {9,-10} {10,-10} {11,-15} {12,-15}",
recordNumber++, student.Name, student.Role, student.Telephone, student.Email, "-", "-", "-", student.Subject, student.Subject2, student.PrvSubject, student.PrvSubject2);
break;
Thank you for the tip, I'll adjust my classes
You seem to have 13 slots in this string and 12 arguments
That's why string interpolation is better
Thank you for the help 🙂 I have completed the code
Nice