tags:

views:

261

answers:

9

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.

+2  A: 

Hm, obviously SQL Express is a full blown database - otohj it may make sense. Why NOT use a databsae if they already have one ?;)

Otherwise I would possibly go with a XML file.

TomTom
They don't already have one.
wcm
THen XML - UNLESS you can foresee other projects or more functionalityx, then SQL Express.
TomTom
+2  A: 

I would recommend an XML file and a typed dataset.
You will need to figure out where to put the XML file.

Note that if you ever want to allow multiple users to use it, you need to use a database, such as Access or SQL Server.

SLaks
Point taken. Right now, only one or two people in the special education department will be using it.
wcm
Why does he *need* to use a database for multiple users? The only issues would be with updating the data inside the file but that can still be easily controlled through only allowing 1 editor at a time.
Chris Marisic
+9  A: 

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.

CResults
You make excellent points in your edit. However this scheduling issue has less to do with teacher or student availability than state and federal rules about how much time needs to pass for different kinds of reviews and meetings. Thanks for your input :o)
wcm
+1 for pushing for a db of some sort. Apps originally written for two users have two lifetime endpoints: 0 users because the app is bad or unnecessary, in which case it doesn't matter what you do, or many users because it keeps growing, in which case if you don't have some db technology up front, you will pay dearly for it later.
cdkMoose
+1  A: 

I'd go for

  • SQL Server Express (free and full blown relational database)
  • XML/JSON if you don't want a database (LINQ to XML might be a big help here).
Bart
+2  A: 

I would have to second the Json answer and SQL Lite.

Another option would be to use the built in database that's included in all of windows (since Windows 2000), ESENT. There is a codeplex project to make it easy to work with http://managedesent.codeplex.com/

Chris Marisic
I always wonder why this seems to be so little of a popular answer when anyone asks a question about a local data store for an application and there's already a database provided by Microsoft ready to go. Although I believe it's alot more like a NoSQL db vs normal db.
Chris Marisic
+1  A: 

xml files seems to be a good option. using Linq to xml it should be quite easy to read/write the files from objects/to objects. check out XDocument and XElement classes Access Databases, SQL Lite, and SQL Server Express seens like an overkill. do you really need a database to store a simple calendar data? is your application going to grow?

Ami
I don't anticipate it growing much at all.
wcm
+3  A: 

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.

p.campbell
Going with SQLite also puts you in a good position to move to a chunkier database should requirements later demand it.
David Dorward
A: 

I'd use serialized classes.

SLC
+1  A: 

From "simple stand alone Windows app" it sounds to me like it's not critical. I'd go with whatever is easiest, or what you are most comfortable with. XML is usefully human readable, but a sensibly formatted flat file might be just as sensible.

penguat