tags:

views:

49

answers:

4

Basically, I want to have a database that's lightweight and I won't need to install a million other things on my clients computers for them to access this.

I just need a simple method of reading and writing values so that they're not hardcoded into the program. I could do MySQL (which is what I'm very familiar with), but it doesn't need to be making calls remotely.

I would have less than 10 fields and one table, if that matters. Thanks!

+1  A: 

If it's over .NET, what about Isolated storage?

Ariel
+3  A: 

XML would probably be the simplest option, and is completely built into the framework (no extra dependencies). Here's some sample XML parsing code for VB.NET.

SQLite is a good, very lightweight alternative if you want a "database" like MySQL (although lighter, and a bit more restricted, but for 1 table, it probably doesn't matter).

Reed Copsey
+1 to Xml. Super easy to use, very light-weight...and portable. You can't really ask for a better option, IMO
dboarman
+1 for sqlite .
Nifle
A: 

If you're just talking about configuration, simply use the Settings feature of .NET. Use Add New Item to add a Settings file to your project, edit it and add the kind of values you want. You'll get strongly-typed configuration values with no coding.

John Saunders
A: 

Depending on who can access those configurations/settings/savings, I would suggest these options:

  1. local XML-file or similar format file in the folder with the program
  2. local ASCII file, where each line begins with a "label", then a delimiter charcode like ":" and then the value
  3. small SQLlite database, a bit more SQL like, but much more work to do
  4. the local registry on the users PC

Different pros/cons

  1. +very easy to edit (while developing), - bad for security as the user could tamper content easy, you have API support for reading XML, but format must follow XML

  2. same as XML, but no API support, but its quite flat, so less parsing might be needed. Just read every line into a large array and overwrite file when saving

  3. SQLlite is a bit more protected as it is a SQL database, but filebased, so this can only be opened by one program at a time. You cant share it between two programs at the same time.

  4. Registry is accessable through API, but this is "hidden" inside windows, so if you move the program, you loose the settings unless you make some sort of "backup/transfer" option. Clever users might know how to open RegistryEditor and try to export and import them manually, but normal users will have trouble.

So... depending on your use and security level, you could choose from those above.

Lastly, if you have a webserver running and think these programs should access internet, its farely easy to build a webservice which will allow you to save and load from an internetaddress too. Problem arise when the user is offline. What settings will you use then.

BerggreenDK
considering your initial list of fields, I would go for a simple ascii file - make the "save/load" as a seperate class and then "hardcode" it while you develop your program and figure out which settings you need. Then replace the class later with a more trustworthy solution. What I am saying is, get the program running first, worry about the config structure later.
BerggreenDK