Database functionality with WPF app: SQLite, SQL CE, other?

Alan Le picture Alan Le · Sep 15, 2008 · Viewed 20.3k times · Source

I want to extend a WPF application with database functionality. Which database engine would you suggest and why? SQLite, SQL CE, other?

Answer

John Rennemeyer picture John Rennemeyer · Sep 15, 2008

Depending on the applications use, I would recommend using SQL Lite because it doesn't require you to install any other software (SQL CE or Express, etc. usually would require a separate install).

A list of the most important benefits for SQL Lite from the provider link at the bottom of this post:

SQLite is a small C library that implements a self-contained, embeddable, zero-configuration SQL database engine. Features include:

  • Zero-configuration - no setup or administration needed.
  • Implements most of SQL92. (Features not supported)
  • A complete database is stored in a single disk file.
  • Database files can be freely shared between machines with different byte orders.
  • Supports databases up to 2 terabytes (2^41 bytes) in size.
  • Small code footprint: less than 30K lines of C code, less than 250KB code space (gcc on i486)
  • Faster than popular client/server database engines for most common operations.
  • Simple, easy to use API.
  • Self-contained: no external dependencies.
  • Sources are in the public domain. Use for any purpose.

Since you're using WPF I can assume you're using at least .NET 3.0. I would then recommend going to .NET 3.5 SP1 (sames size as .NET 3.5 but includes a bunch of performance improvements) which includes LINQ.

When using SQLite, however, you would want to use the following SQLite Provider which should provide LINQ support: An open source ADO.NET provider for the SQLite database engine