tags:

views:

188

answers:

6

What is a good way to distribute a small database on CD-ROM?

The Database has to be encrypted. It must run on WinXP and Vista. The application is written in C# and is also distributed on CD. Records are only read but not written.

Its ok to run an installer, but we prefer not to do it.

The DB has 100000 records and performance is not the primary goal.

EDIT: Yes the user will have to enter a password to decrypt the database.

+6  A: 

I would use SQLite for this.

Actually re-reading your question, you could even use a flat or an XML file, given that there is no need for performance or updates/adds.

If there is any chance you will need to add/update this data source as your app matures, though, go with SQLite.

Galwegian
+2  A: 

Honestly... If you can do it I would use encrypted XML files. No install,runs anywhere (text files have no dependencies), fast and since updates are not necessary, that would make it even easier.

Antonio Louro
+2  A: 

SQL Server CE is a stripped down version of SqlServer (CE stands for Compact Edition) that supports encryption. The DB consists in one single file.

The software consists in a set of DLL that you copy side by side with your exe.

(Don't be fooled by the CE: There is a Desktop Windows version in addition to the Windows Mobile version.)

Serge - appTranslator
I think CE stands for Cripple Edition :)
leppie
Naaah! It's Cute Edition :-D
Serge - appTranslator
SQL Server CE has an install. The dll is not sufficient to run it.
jle
+2  A: 

If you work for a govt agency in the UK, try not to leave the CD on the train or send it in the post... :)

JonoW
I know it's a droll comment, but it brings up a valid point - why does this database need to be encrypted - is it holding sensitive data? If so, then it shouldn't be on a CD, especially alongside the application that includes the decryption keys!
JeeBee
+1  A: 

The Database has to be encrypted

Quick question: How do you decrypt it? Properly, by having the user type in the decryption password, or improperly by adding the decryption key to your application, which means it can be easily extracted?

Because if it's solution 2, then you can broaden your possible database options by dropping the encryption requirement altogether.

I was looking for an embedded database also, and based on the answers I received, I went with SQLite, which is easy to implement.

Michael Stum
A: 

As others pointed out, there databases which support read-only access.

As for encryption, SQLite has at least one extension supporting encryption

You may also choose any read-only dbms and keep pk's and fk's, but encrypt the contents fields manually (i.e. by code)

devio