How SQL Express works with an application

E

Elmo Watson

Let's say I build an app which includes a new sql Express database. I build
the database and it's a totally independent .mdf file

When it's distributed with the database file, does the end-user need to have
SQL Express installed on his computer, or will the application work with the
database, just like it would, if the database was MS Access?
 
R

Ravi Bhavnani

The user will need to have SQL Server, SQL Express, or at least MSDE
installed.

/ravi
 
B

BlackWasp

An alternative (if it provides enough functionality) would be to use SQL
Server CE. You can use this completely stand-alone with a reference in your
project and can also synchronise with full-blown SQL Server.

There are a few limitations to CE though such as less data types, lack of
stored procedures, etc.
 
E

Evan M.

How does one make use of SQL Server CE with a WinForms application?
I'm currently creating one that needs to have a read-only local cache
of data that users can use when offline, so from what I've read, CE
sounds like the right thing. However, I have only been able to find
some basic information about programming against it. None of the
information that I've found has discussed deploying WinForms apps that
use it.

1) Does the user need to have CE "installed" on their machine prior to
using the application?
2) How do you configure the where the offline cache gets stored
(program needs to be able to run in non-administrator mode)?
 
B

BlackWasp

Hi Evan,

once you have installed CE on your development machine you simply reference
the installed 'System.Data.SqlServerCe.dll' assembly. When distributing you
distribute the relevant DLLs; there is no need to install as a separate
exercise on the target machine as the entire system is DLL and file-based.
However, where you don't have control of the final environment
(shrink-wrapped software), you should install using the SSCERuntime-ENU.msi
installer. There is no running service, unlike full-blown SQL or Express
edition. The files you need to distribute are in the REDIST.TXT file in the
SQL CE installation folder. Read the ReadmeSSCE35_ENU.htm in your install
folder too (assuming you are using CE3.5).

Once referenced in your application it is pretty similar to use to standard
SQL. Your class names are different, eg. SqlCeConnection rather than
SqlConnection and as I mentioned before, there are a few limitations. For
your off-line work it could be a good fit though, especially when using the
IIS functionality to provide synchronisation with SQL Server.

Check out http://www.microsoft.com/sql/editions/compact/redistribute.mspx
for information on redistribution rights (it's free but you must register
via Windows Live to become authorised to redistribute) and the EULA.

There's also a SQL Server CE blog at
http://blogs.msdn.com/sqlservercompact/.
Also it is worth reviewing the article on choosing which version of SQL to
use between CE and Express at
http://www.microsoft.com/sql/editions/compact/sscecomparison.mspx;

--

BlackWasp
www.blackwasp.co.uk


How does one make use of SQL Server CE with a WinForms application?
I'm currently creating one that needs to have a read-only local cache
of data that users can use when offline, so from what I've read, CE
sounds like the right thing. However, I have only been able to find
some basic information about programming against it. None of the
information that I've found has discussed deploying WinForms apps that
use it.

1) Does the user need to have CE "installed" on their machine prior to
using the application?
2) How do you configure the where the offline cache gets stored
(program needs to be able to run in non-administrator mode)?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top