views:

1840

answers:

13

I was (and still am) looking for an embedded database to be used in a .net (c#) application. The caveat: The Application (or at least the database) is stored on a Network drive, but only used by 1 user at a time.

Now, my first idea was SQL Server Compact edition. That is really nicely integreated, but it can not run off a network.

Firebird seems to have the same issue, but the .net Integration seems to be not really first-class and is largely undocumented.

Blackfish SQL looks interesting, but there is no trial of the .net Version. Pricing is also OK.

Any other suggestions of something that works well with .net and runs off a network without the need of actually installing a server software?

+14  A: 

SQLite came to my mind while reading your question, and I'm quite sure that it's possible to access it from a network drive if you keep yourself to the constraint of 1 user at a time.

[edit:] added some more links to get you started with using SQLite with .NET: http://www.mikeduncan.com/sqlite-on-dotnet-in-3-mins/

Sven
I've tested it during the past weeks, and SQLite is really a great product. It is not a full flavorued RDBMS of course, but it has all the features needed to get the job done.
Michael Stum
+2  A: 

Check out VistaDB. They have a very good product, the server version (3.4) is in Beta and is very close to release.

Yaakov Ellis
+2  A: 

Why not use SQL Server 2005 Express edition? It really depends on what you mean by "embedded" - but you can redistribute SQLServer2005E with your applications and the user never has to know it's there.

http://msdn.microsoft.com/en-us/library/ms165660.aspx

http://msdn.microsoft.com/en-us/library/bb264562.aspx

James D
+5  A: 

It sounds like ADO/Access is perfect for your needs. It's baked into the MS stack, well seasoned, and multi-user.

You can programatically create a DB like so:

Dim catalog as New ADOX.Catalog
Catalog.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\server\path\to\db.mdb")

You can then use standard ADO.NET methods to interact with the database.

Justin Walgran
+2  A: 

@CodingTheWheel: Because it needs installation on a server, and the user will notice a service running in the background, latest when the alarm bells of every network security tool go off.

Embedded means that it's part of the application or a separate .dll, but that it does not require any installation, does not try to do stuff in the registry, and does not leave any files behind when you delete it, except for the database.

SQL Server Express is not embedded, Microsoft is using "embedding" as "Packaging with your application but still being a separate thing with dependencies". There are many use cases for it, but mine is not one of it.

Michael Stum
+4  A: 

You can use the firebird embeded, it's just a dll that you will need to ship with you app.

About things being undocumented, that's not really true, the firebird .NET driver implements the ADO Interfaces, so if you know ADO you can work with Firebird, basically instead of SQLConnection you will use FBConnection and so on, but my advice is to write a data access layer and use just interfaces on your code, something like this:

using FirebirdSql.Data.FirebirdClient;

public static IDbConnection MyConnection()
{
FbConnection cn = new FbConnection("...");
return cn;
}

This example is very simple, but you will not need much more than that.

We use firebird for our all application without any problems, you should at least try it out.

Fabio Gomes
A: 

There's also Valentina. I cam e across this product when I was working on some Real Basic project. The RB version is very good.

Stephen Cox
+2  A: 

@Sven:

SQLite actually has rather comprehensive file locking, and a SQLite database can definitely be accessed by multiple users at a single time. On filesystems that support it, SQLite will even use byte-range instead of whole-file locking to improve the performance of multiple simultaneous uses of the same database.

It's not Access; it's pretty robust.

Chris Hanson
+5  A: 

I'd recommend Advantage Database Server (www.advantagedatabase.com). It's a mature embedded DB with great support and accessible from many development languages in addition to .NET. The "local" version is free, runs within your application in the form of a DLL, requires no installation on the server/network share, and supports all major DB features. You can store the DB and/or application files all on the network; it doesn't care where the data is.

Disclaimer: I am an engineer in the ADS R&D group. I promise, it rocks :)

Peter Funk
+2  A: 

A little late to the post here.. And VistaDB is already mentioned, but I wanted to point out that VistaDB is 100% managed (since your post was tagged .net). It can run from a shared network drive, and is 1MB xcopy deployed.

Since you mention SQL CE, we also support T-SQL Syntax and datatypes (in fact more than SQL CE) and have updateable views, TSQL Procs and other things missing in SQL CE.

Jason Short
A: 

I'm puzzled.

You're asking for an embeded database - where the database itself is stored on the server. that translates to storing the data file on a network share. You then say that SQL Compact Edition won't work... except that if one looks at this document:

http://download.microsoft.com/download/A/4/7/A47B7B0E-976D-4F49-B15D-F02ADE638EBE/Compact_Express_Comparison.doc

On page 8 you have a nice big green tick next to "Data file storage on a network share".

So it seems to me that you're first thought was the right one.

Have fun,

Murph

Murph
That's funny, because SQL Server specifically tells me it won't: http://img512.imageshack.us/img512/6082/sqlceerror.jpg - maybe it's a misunderstanding, as creating seems to not be possible, while accessing could work. However, for my purposes, creating the database on Application Launch was critical.
Michael Stum
Reality trumps documentation in almost every case - question then arises as to why the docs say the "wrong" thing (or at least how the discrepancy arises). [FX:Browse, Browse] Information is fairly thin on the ground in MSDN
Murph
You _CAN_ store your database in SQL Server on a network store, but only 1 SQL Server can access it. And you are then running in attached mode which is slower than dirt. Just because you can doesn't mean you should. He was asking about each app accessing the database directly, not through a server app.
Jason Short
Jason, without wishing to be rude, about half of that comment is wrong because we're not talking about a multi-user server version at any point, just the compact version which is basically a .DLL (unlike Express or the other "server" versions).
Murph
+2  A: 

you can use siaqodb - http://siaqodb.com .It is .net embedded database engine, very fast, small footprint, native LINQ query engine, zero config...

sqo
A: 

Hi,

Have you considered an OODB? From the various open sources alternatives I recommend db4o (sorry for the self promotion :)) which can run either embedded or in client/server mode.

Best

Adriano

Vagaus