1

I have two different options using database in a desktop application. I prefer the Service-based database even locally. But should I use the Local database instead?

Benny Skogberg
  • 10,051
  • 11
  • 49
  • 82

5 Answers5

6

Best integrated in the .Net / VS enviroment is properly MS SQL Compact:

http://en.wikipedia.org/wiki/SQL_Server_Compact

But there are alternative like:

http://en.wikipedia.org/wiki/SQLite

Is there a .NET/C# wrapper for SQLite?

Community
  • 1
  • 1
Lasse Espeholt
  • 17,432
  • 5
  • 61
  • 99
  • The SQLite for Android and Python I'm familiar with, but I didn't know there is one for .NET as well. Thanx for heads up! BR - – Benny Skogberg Aug 10 '10 at 19:00
3

Usually depends on where it'll be deployed. If you're deploying it in an environment that you control I'd usually go with a service-based, but if you need to send it out to clients it depends on the client. Clients with technical staff would probably want the service-based, but if it's a small client with no technical staff/knowledge that just want to click and run, then a local database might be best.

Hans Olsson
  • 53,038
  • 14
  • 91
  • 113
  • This is important stuff. Sometimes one want to send the app to a non-tech customer just showing capabilities. Your approach on the answer gives my insight I didn't have! BR - – Benny Skogberg Aug 10 '10 at 18:58
3

Depends of further requirements.

Server-Based: MS-SQL Express. Is essentially the same engine as larger editions, this will scale well when you need it bigger. Note that there is an attached-file mode that means you don't need to permanently register each database with the server.

Local: SQL Compact Editon, embedded file-based solution. Much easier to deploy but not 100% upward compatible. Basically a single-user solution (but that is going to change with v4)

Henk Holterman
  • 250,905
  • 30
  • 306
  • 490
  • Thanx for clearing this out. I'd expect something like this but never really knew exactly pros and cons of the different databases. BR - – Benny Skogberg Aug 10 '10 at 18:55
3

For a desktop application you should consider using Sqlite, with the C# wrapper library here, I've been using it in a project and it works great, easy to use, quick and everything goes into a single file.

It's not designed for multiple user environment though, so you wouldn't want to use it as the database for a web service backend for instance.

I also use NHibernate and NHibernate.Linq to interact with the data, you can get a build of both which are compatible here: http://www.dennisdoomen.net/2009/07/nhibernate-210-ga-with-linq-and-fluent.html

theburningmonk
  • 15,283
  • 13
  • 58
  • 103
2

You must take a look at Firebird

Hugues Van Landeghem
  • 6,739
  • 3
  • 32
  • 56