Click here to Skip to main content
15,895,803 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have a C# assignment where I have to design an inventory software for furniture import and export company. My software design(classes/inheritance) is the main thing that will be evaluated. But to run the application I have to save dummy values somewhere(Customers, Items and transactions). I was thinking to save them in text files. I would be very thankful if you people can suggest me simple and better way to do that. Because I do not want to spend much time on it when it is not important. I am using windows form application.
Posted
Comments
PIEBALDconsult 25-Oct-15 1:11am    
I recommend a relational database system.

You really, really need to embrace the idea of separation of concerns. System.Windows.Forms has nothing to do with databases, so you can combine it with database technology of your choice, depending on what you want to achieve. For starters, please review these lists:
https://en.wikipedia.org/wiki/Comparison_of_database_tools[^],
https://en.wikipedia.org/wiki/Comparison_of_relational_database_management_systems[^],
https://en.wikipedia.org/wiki/Comparison_of_object_database_management_systems[^].

—SA
 
Share this answer
 
As your main concern is not to create a database, I would recommend to save your data in a file. Otherwise you will end up spending a lot of time learning the syntax of SQL and also database structure and administration. (Assuming you will use your local PC and not a database hosted on a server)

In this case I think XML would be a good choice, because you can use DataTable and DataSet to bind your windows form controls to. There are methods already available to read and write XML data to/from disk.
Also, if you would change your mind later on and decide to store the data in a database, the changes in your code will not be very big.

You still need to design a table structure in your data set, but Visual Studio is pretty helpful with that. Here is a good starting point Working with Datasets in Visual Studio[^]

As it is recommended not to bind a DataSet directly to Form Controls, you also need to look into the BindingSource class[^].

* So start with finding the different data variables you will use and create your data structure.
* Make a design for how to present the data in the form.
* Connect the data and the view together.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900