views:

107

answers:

5

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?

+5  A: 

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

http://stackoverflow.com/questions/93654/is-there-a-net-c-wrapper-for-sqlite

lasseespeholt
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 -
BennySkogberg
+3  A: 

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.

ho1
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 -
BennySkogberg
+1  A: 

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
Thanx for clearing this out. I'd expect something like this but never really knew exactly pros and cons of the different databases. BR -
BennySkogberg
+1  A: 

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
I'm familiar with sqlite in Android and Python environments, but didn't know it worked on .NET as well. Thanx for making this clear for me. BR -
BennySkogberg
+1  A: 

You must take a look at Firebird

Hugues Van Landeghem
Thanx! I'll check it out! BR
BennySkogberg