Let us say that I want to create a custom Sales and Inventory application for a client. What is the advantage of using a database over using datafiles? Can't they both store the same information and access the same data?
Printable View
Let us say that I want to create a custom Sales and Inventory application for a client. What is the advantage of using a database over using datafiles? Can't they both store the same information and access the same data?
I love this place and thank you for your response.
Forgive me as I'm not very experienced (I do this for fun), but it is my understanding that I must update either a database or a datafile with new information when it changes. What exactly is the low level housekeeping code you refer to?
There's thing like Primary Key, Foreign Key and data organization. ADO .Net was designed to Edit/Update/Delete database data. Why would you not use a database for a Sales/Inventory system???
If you use a DataGridView, DataTable, DataAdaptor and a CommandBuilder, you don’t have to handle your Add/Update/Delete commands. It can all be done with a few lines of code…
I actually just showed how to do that here https://www.vbforums.com/showthread....ers-for-SQLite
Post #10
Either way can get the job done. The question really comes down to scale. Adding a database does require a bit of work that you wouldn't need with a datafile, but you get a lot of extra capability from that extra work. Therefore, the tradeoff is a bit hard to figure, though it almost always ends up favoring the database in the long run.
Datafiles can be extremely simple and easy to work with, so long as the limitations of the datafile are acceptable. If all you are doing is working with one table, or something so simple that you could put it into a single sheet of a spreadsheet (not numerous pages in a workbook), then the datafile would be the way to go up until the size of the thing got quite large.
If the data gets quite large, or covers multiple tables, especially tables that relate together in some way, then the capabilities offered up by a database are sufficiently advantageous that a database becomes the choice over a datafile. For that reason, most data management projects end up using databases. Those projects simple enough that a datafile is sufficient, tend to be rare.
Also, what starts as a small project, if reasonably successful, tends to snowball over time, which means that you might start out with something that can reasonably fit in a datafile....and then it no longer does.
A Sales and Inventory system is not a simple one table application. If this is your goal then I'd suggest learning how to work with a database.
First, thank you for a very helpful response and actually answering the question. (What is the advantage of using a database over using datafiles?)
My friend has a small concession stand in the hallway between the PX and Commissary of the local military base. She doesn't handle more than 50 items and could probably continue to run it quite well on paper and memory but wanted to see about making it more formal and easier to record/view the big picture. Since I've been working with datafiles for a long time and the task was small, I felt it would easily handle the job.
One thing I didn't consider is "tables that relate together in some way" and I can see the advantage to that even in such a small project.