views:

79

answers:

3

Background - If I am building a WPF desktop application (VS2010 & .NET 4) and would like a lightweight database to use but without having to have a separate installation. SQLite would be OK from what I read however I was thinking it would be good to stick with the Microsoft bits and try to use SQL Server CE.

Question - Does SQL Server CE require an "installation" separate to my WPF application's installation? Or does it just require me to create the database (as I can) within VS2010 and ensure the appropriate DLL is contained in the application when it's deployed? I'm looking at the doco at the following link and it's not clear to me...

http://technet.microsoft.com/en-us/library/bb190958(SQL.100).aspx

thanks

PS. Another worrying item I see is "If you install Windows XP SP2, to use SQL Server Compact connectivity, you will have to enable HTTP access. The default setting is to disable HTTP access", from the page http://technet.microsoft.com/en-us/library/ms171869(SQL.100).aspx So hopefully this is not another complication to being able to use CE with no installation issues/fuss?

+1  A: 

Sql Server CE version 4 will not require installation but it has not been released yet (Not even a beta). You can read more about it here: New Embedded Database Support with ASP.NET

If I were you I would just stick with Sqlite. It's free, has an excellent .Net provider with Entity Framework support and is really fast.

Giorgi
thanks - so no glaring advantages with CE over Sqlite you know of for a simple DB structure?
Greg
-1 **Wrong**. This isn't a reason to choose Sqllite. That link is about installing for use with ASP.net applications. SQL Server CE 2005 doesn't require installation for desktop apps. [Just copy the DLLs as described on MSDN](http://stackoverflow.com/questions/3341861/sql-server-ce-is-an-installation-required-as-opposed-to-just-a-dll-include/3395186#3395186)
MarkJ
Check (my answer below) what Microsoft says about installing SQL Server Combact 3.5
ileon
A: 

According to this Microsoft document:

"To install Microsoft SQL Server Compact 3.5 (SQL Server Compact 3.5) with the application, you must run the SQL Server Compact 3.5 installer for desktop computers (SSCERuntime-ENU.msi). Installing SQL Server Compact 3.5 by running the installer registers the native DLLs and puts the managed assemblies in the Global Assembly Cache. This makes sure that the installation of the SQL Server Compact 3.5 on the computer can be serviced by Microsoft Update or similar technologies in future."

See also this article (LINQ and Deploying SQL Server CE 3.5)

ileon
Originally Msft had said that the MSI was required for deployments as in your link, but they had also left open the dll-only process in a roundabout way, since the app will automatically load sqlce DLLs in the app's local directory before those placed in program files by the installer. Looks like that with the VS2010 docs (MarkJ's link) they've come out and explicity supported the dll bundling approach (which your second link also describes)
Anthony
@Anthony, @ileon. I think Anthony's correct and you don't have to run the installer. If you do run the installer, sqlce will be updated by Windows Update. If you copy the DLLs locally, they won't be.
MarkJ
@Anthony, @MarkJ: I agree and I prefer private "installations".
ileon
+2  A: 

You don't need an installation for SQL Server CE 2005. Just copy the DLLs as described on MSDN. Administrator priviliges are not required.

MarkJ