I currently have a system that saves student data to a text file. I can search for individual students and have their information output to screen. How can I make my system output every student in the text file to screen?
Thanks,
TomByrne94
Printable View
I currently have a system that saves student data to a text file. I can search for individual students and have their information output to screen. How can I make my system output every student in the text file to screen?
Thanks,
TomByrne94
You need to be a bit more specific than "to screen". How exactly do you want the data displayed? Surely if you know how to display one record then you know how to display all of them. If you know how to take one step then does that not automatically mean that you know how to walk down the street? It's just taking one step multiple times.
At the moment I search for a particular student and then run this code to output their data.
vb Code:
Console.WriteLine("ID: " + student.ID.ToString) Console.WriteLine("First Name: " + student.StudentFName) Console.WriteLine("Second Name: " + student.StudentSName) Console.WriteLine("Criteria One: " + student.L1Criteria1) Console.WriteLine("Criteria Two: " + student.L1Criteria2) Console.WriteLine("Criteria Three: " + student.L1Criteria3.ToString) Console.WriteLine("Criteria Four: " + student.L1Criteria4.ToString) Console.WriteLine("Criteria Five: " + student.L1Criteria5.ToString) Console.WriteLine("Criteria Six: " + student.L1Criteria6.ToString) Console.WriteLine("Criteria Seven: " + student.L1Criteria7.ToString) Console.WriteLine("Criteria Eight: " + student.L1Criteria8.ToString) Console.WriteLine("Criteria Nine: " + student.L1Criteria9.ToString) Console.WriteLine("Criteria Ten: " + student.L1Criteria10.ToString) Console.WriteLine("Criteria Eleven: " + student.L1Criteria11.ToString) Console.WriteLine(" ")
How can I skip out searching for a particular student and then outputting all of the students one by one in that format?
You are again relying on our mind-reading powers. If we don't know how you're getting that one record then how can we tell you how to change it to get them all? We could guess but, if we're wrong, we've wasted our time and yours. Presumably you have some sort of filter in place so simply remove that filter and you'll get all records. I can't be more specific than that without knowing, or guessing, exactly how the filtering is done. Once you've got all the records then you can just loop through the list and do the same inside the loop as you're already doing for your one record.