我应该选择什么数据源?
我想征求建议。
在我们的 Visual Basic 课程中,我们需要提交一个具有时间监控功能的工资系统。我已经准备好了我的系统的GUI界面。我的问题是,考虑到 30 名员工(这是我们的讲师告诉我们的),我应该使用什么样的数据集合。
我应该使用:
像每个字段一样存储它们的数组(员工编号、员工姓氏 )等)有自己的数组。
供我将它们存储在文本文件中的顺序文件(如果在文本文件中,我仍然可以检索该文本文件中的记录。)
数据库。
我需要关于我应该选择什么的建议。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
数组就可以了,因为它们很容易根据您的项目大小实现。您可以为
Employers
创建一个类,并定义一个Employers
数组以将其信息存储在您的应用程序中。如果您想使用文件将这些数据保存到磁盘,请考虑使用内置的 .NET XML 序列化程序。
最后,您可以使用数据库来存储大量数据,但同样,对于 30 个雇主,您不需要数据库。
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 ofEmployers
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.
在大多数业务应用程序中,您将使用数据库。原因之一是,当稍后与更多数据结合时,这些数据会变得更有用。或者可能存在使这项工作变得更容易的现有数据。例如,可能需要所谓的员工主表。这将包含姓名、地址、ss#、部门、活跃、终止日期、职位等内容。您的工资系统可能需要强制执行一条规则,即我们不会向超过终止日期的员工支付工资。此外,一旦开始运行,管理层可能希望按部门分析加班时间。
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.
我同意数据库将是现实世界中最好、最有用的。您可以使用多维数组,但我不推荐它。数组也可以工作。
我认为最简单的是用某些字符(通常是命令或 tilda)分隔的平面文本文件,您可以使用 I/O 来访问它。
但数据库将是首选。
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.