Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What format do I use to store a relatively small amount of user data

Tags:

c#

winforms

I am writing a small program for our local high school (pro bono). The program has an interface allows the user to enter school holidays. This is a simple stand alone Windows app.

What format should I use to store the data? A big relational data is obviously overkill.

My initial plan was to store the data in an XML file. Co-workers have been suggesting that I use JSON files, Access Databases, SQL Lite, and SQL Server Express. There was even a suggestion of old school INI files.

like image 656
wcm Avatar asked Apr 19 '10 13:04

wcm


People also ask

What format should data be stored in?

CSV (Comma Separated Values) CSV is one of the most common file formats for storing textual data. These files can be opened using a wide variety of programs including Notepad. The reason behind using this format over others is its ability to store complex data in a simple and readable way.

Which is the best format to store and manage the data?

Best formats for preservationTextual data: XML, TXT, HTML, PDF/A (Archival PDF) Tabular data (including spreadsheets): CSV. Databases: XML, CSV. Images: TIFF, PNG, JPEG (note: JPEGS are a 'lossy' format which lose information when re-saved, so only use them if you are not concerned about image quality)

What are different data formats?

Data Formats Research data comes in many varied formats: text, numeric, multimedia, models, software languages, discipline specific (e.g. crystallographic information file (CIF) in chemistry), and instrument specific.


2 Answers

Projects like this have a habit of getting bigger, quickly, and if they do your XML file will become complex and a burden to manage.

I would not recommend storing the data in an xml file or json - they are just text files by a different name, all suffering from the same problem - you don't have any control over who edits them.

Use some kind of db, starting from the small ones first (Access, SQLLite)

Edit

Based on your latest comments, roll forward to a point where the users have been using the app for two years.

  • How much data do you expect to have stored by then?
  • Will the user(s) need to look back through historic data to see, for example, what they did this time last year

And more so, right now

  • What is Teacher A doing on Thursday afternoon
  • Will Teacher B be free to attend event on 15th May 2010?
  • Can Student C attend event D?

All of these questions/problems are a lot easier/more efficient to handle with SQL. Plus your resulting codebase will make a lot more sense. Traversing XML isn't the prettiest of things to do.

Plus if your user base is familiar with Excel already, linking Excel to a SQL database (and produce custom results) is a lot easier than doing the same with XML.

like image 86
CResults Avatar answered Oct 14 '22 00:10

CResults


Have you considered using SQLite? It'll result in a small .s3db file. SQLite is used by all kinds of desktop applications for local storage.

There's a SQLite .NET library that'll allow you to use ADO.NET to CRUD your data.

Check out Mike Duncan's article on how to get started with SQLite in .NET.

like image 30
p.campbell Avatar answered Oct 13 '22 22:10

p.campbell