Reputation: 508
I would like to ask for suggestions.
In our class in Visual Basic, we are required to turn in a payroll system with time monitoring. And I have prepared already the GUI interface of my system. My question is what kind of collection of data should I use, considering the employee population of 30 (that's what our instructor have told us.)
Should I use:
Arrays to store them like every field (employee number, employee last name, etc.) has its own array.
Sequential files for me to store them in a text file (and if in the text file, could I still retrieve the records inside that text file.)
A Database.
I need suggestions on what should I choose.
Upvotes: 0
Views: 95
Reputation: 12243
I agree a Database would be the best and most useful in the real world. You could get away with a multi-dimensional array, but I wouldn't recommend it. Also a array would work as well.
The easiest in my opinion would be a flat text file delimited with some character (usually command or tilda) and you can use I/O to access it.
But database would be a first choice.
Upvotes: 1
Reputation: 20404
Arrays would be OK as they're easy to implement for the size of your project. You can create a class for Employers
and define an array of Employers
to store their information in your application.
If you want to use files to save those data to disk, consider using the in-built .NET XML serializer.
Finally you can use DBs to store larger amounts of data but again for only 30 employers, you won't need a database.
Upvotes: 1
Reputation: 67
In most business applications, you will be using a database. One reason is this data becomes more useful when combined with more data later. Or there may be existing data that makes this job easier. For example, there may be a need for what's called an employee master table. This would contain things like name, address , ss#,department, active, termination date, position etc. Your payroll system may need to enforce a rule that we don't pay people who have been terminated past their termination date. Also, once this is up an running, management may want to analyze overtime hours by department.
Upvotes: 1