Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Writing a C# desktop application that needs to embed an encrypted database. What type of database should I use?

Hey SO'ers, I'm making a C#/WPF app that needs to access a number of tables to generate some of the xaml code I will use in the app. The tables will also contain some floating point numerical data as well.

The program is single-user, so the rdbms doesn't have to be very fancy, but the file does need to be encrypted as it will be "shrink-wrapped" and sent. I also can't force a user to install a separate program for this.

So far I've been leaning towards using an encrypted .accdb database, but am open to better options. Does using accdb require the user to have access installed?

(NOTE: I have also been looking at Database engine for a desktop application in C# and )

like image 330
calvin Avatar asked Nov 18 '09 16:11

calvin


People also ask

Is compiler construction hard?

Compiler construction is a complex task. A good compiler combines ideas from formal language theory, from the study of algorithms, from artificial intelligence, from systems design, from computer architecture, and from the theory of programming languages and applies them to the problem of translating a program.


2 Answers

SQL Server Compact Edition and SQL Lite appear to be your main two options. SQL Server Compact has better .NET integration and Date/Time handling so I would go with that one. Also, the redistributable files are fairly low-weight (2-3MB IIRC).

SQL Server Compact will allow you to encrypt the database:

http://technet.microsoft.com/en-us/library/ms172901.aspx

...But you will have to be careful with your connection string because it is trivial to obtain an unencrypted password embedded in the client.

One last note: Selecting SQL Server Compact will enable you to use the built-in LINQ provider, which has the potential to make your life a lot easier.

like image 165
Robert Venables Avatar answered Sep 28 '22 07:09

Robert Venables


Have you looked into SQL Server Compact?

SQL Server Compact 3.5 is a free, easy-to-use embedded database engine that lets developers build robust Windows Desktop and mobile applications that run on all Windows platforms including Windows XP, Vista, Pocket PC, and Smartphone.

"I also can't force a user to install a separate program for this." - you can distribute the required files with your application.

Another solution is to use an encrypted xml file. The Dataset can very easily be saved and loaded using an xml file:

  • DataSet.WriteXml
  • DataSet.ReadXml
like image 37
Philip Wallace Avatar answered Sep 28 '22 06:09

Philip Wallace