|
-
Feb 2nd, 2024, 11:15 PM
#1
Thread Starter
Lively Member
[RESOLVED] DataFile vs DataBase
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 may not know anything, but I know it well!
-
Feb 2nd, 2024, 11:21 PM
#2
Re: DataFile vs DataBase
 Originally Posted by VisualBrian
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?
One difference is that you'll end up writing a ton of low level housekeeping code to interact with and update your data file. That work is already done for you if you use a database.
-
Feb 2nd, 2024, 11:35 PM
#3
Thread Starter
Lively Member
Re: DataFile vs DataBase
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?
I may not know anything, but I know it well!
-
Feb 3rd, 2024, 12:12 AM
#4
Re: DataFile vs DataBase
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???
-
Feb 3rd, 2024, 12:22 AM
#5
Re: DataFile vs DataBase
 Originally Posted by VisualBrian
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?
What's easier? To use a Roomba, or to build a vacuum cleaner yourself from necessary parts (motor, collection bag, tubes, cords, rotating brush, etc.) It can be argued that both take money, electricity, and time.
The answer is obvious.
-
Feb 3rd, 2024, 12:43 AM
#6
Re: DataFile vs DataBase
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…
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Feb 3rd, 2024, 03:40 AM
#7
-
Feb 3rd, 2024, 12:26 PM
#8
Re: DataFile vs DataBase
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.
My usual boring signature: Nothing
 
-
Feb 3rd, 2024, 02:19 PM
#9
Re: DataFile vs DataBase
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.
-
Feb 3rd, 2024, 07:18 PM
#10
Thread Starter
Lively Member
Re: DataFile vs DataBase
 Originally Posted by Shaggy Hiker
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.
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.
I may not know anything, but I know it well!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|