5

I'm wondering what's the best way to create an database application using VS C# 2010 Express Edition and I have two questions:

  1. What should I choose Microsoft SQL Server 2008 or SQL Server Compact 3.5? 2008 seems to be more complicated to install on user's desktop. If I am right, to use Compact you only need to install this server and after that application is just able to use database file.

  2. What should I include into my package, .dll file will be enough or do I need whole for example Sql Server Compact installer?

4
  • 1
    If you're making a desktop application that just needs to persist some data, go with Compact. I /think/ it should be possible to just include it as a DLL but I'm not sure. Commented Apr 1, 2012 at 13:45
  • Yes, I consider desktop application, not big application for large company :) Commented Apr 1, 2012 at 13:47
  • 1
    msdn.microsoft.com/en-us/library/gg213826.aspx seems to be the documentation you're looking for. Commented Apr 1, 2012 at 13:47
  • Great, it seems to be exactly what I was looking for, thanks ;-) Add it as an answer, I'll accept it ;) Commented Apr 1, 2012 at 13:57

3 Answers 3

5

You may use LocalDB from new SQL Server 2012 Express. I thing it's ideal for desktop apps. More info at MSDN and SQL Server Express WebLog.

Sign up to request clarification or add additional context in comments.

Comments

2

Just to add, might help...
I'd suggest to use NuGet to download / install EntityFramework (type it in there and you'll get a list).
You have two versions, one regular flavor and one for compact edition.
http://nuget.org/packages/EntityFramework/4.3.1
http://nuget.org/packages/entityframework.sqlservercompact
And with that you'll get a basic 'framework' for dealing with databases as well (you'd need just to install the SqlCE (suggest 4 as is newest)) - NuGet installs the dll-s needed.
You can use 'model first' approach with EF (entity framework) to create Db first,
or even better use 'code first' approach - to create Db automatically from your code, classes.
That'd take care of creating new Db etc.
I think that's the easiest way to 'start up' with a new Db. And CE as well.
CE (compact) is a good choice - but watch, it has certain limitations comparing to the standard server SQL (express or standard etc.). E.g. you cannot use I think xml fields, and some other things, stored procedures, views etc. (If I'm correct and remember from before).
Also depends on what you want to make and where to deploy. Desktop doesn't mean that CE is best solution (depends on many details).
hope this helps

2 Comments

Why not just link to the packages on the nuget website? Seems much easier to me than trying to describe them.
maybe to you :) - I didn't have them at hand, I type fast, so that was easier, anyway you're right, just added that.
0

MSDN has some documentation on how to deploy SQL Server Compact with your app. It's indeed possible to both install it separately, or bundle it with your application, which is probably what you want.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.