3

I am currently looking into developing an application in C#. The application will need to use a database backend but I was wondering if it possible to embed a database into the application itself. I.e. the user would not need to install MSSQL or MySQL onto the computers separately to my own app but instead install my program and the database is installed with it. If possible I would like to use something like a MySQL Database but not needing the user to install the MySQL Server. Is there a free option to resolve this problem.

Thanks for your help

1
  • 1
    MySQL isn't the right solution for this scenario. Look at SQL Server Compact (easy scales up to full SQL Server if necessary in the future) or SQLite (popular,stable). Commented Nov 29, 2010 at 23:46

2 Answers 2

4

Look at System.Data.SQLite which can be embedded into your program.

System.Data.SQLite is the original SQLite database engine and a complete ADO.NET 2.0/3.5 provider all rolled into a single mixed mode assembly. It is a complete drop-in replacement for the original sqlite3.dll (you can even rename it to sqlite3.dll if you're using it natively).

Sign up to request clarification or add additional context in comments.

Comments

1

There is also SQL Server Compact which is more similar to Microsoft SQL Server. It also has other threading advantages if you don't use it on network storage.

3 Comments

Very neat, but doesn't support sprocs. Still, compatibility with real SQL Server is an excellent benefit.
The SQL Server compatibility and the built in multi-threading are nice benefits. On the project I work on we enable users to chose between using either of them. We've found that Compact tends to be faster. We also wrote a lot of custom code to work with multi-threading for SQLite. I haven't looked at the latest SQLite so I don't know if that need has changed. Both work and meet needs its all a matter of making an informed decision about what database best meets the situation.
I guess there are still jobs that involve writing real code. AKA, not throw-faster-hardware-at-it web apps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.