[dba-VB] SQL Server Compact 3.5

David McAfee davidmcafee at gmail.com
Fri Oct 29 13:53:15 CDT 2010

Yes, you can (and I do) use Click Once bootstrap to set up SQL CE. I
like the one I wrote
better than some of the ones that I found because it works with our
users and business rules.
I can send you the XML files off line if you want.

You can make Bootstrappers to define prerequisites for your custom
include files as well.
If they don't exist, download and install them :)

You can make bootstrappers for MSIs as well as for Click Once, if you
prefer to create a
MSI installer package.

>From the Solution Explorer, go to your project's Setup Properties
page, click on the
"Prerequisites..." button and check the ones that you need. You
obviously had to put
your custom ones in the required path first to get them to display on this list.

Copy Bootstrapper file(s) to:
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages
so Visual Studio 2008 can see them

The thing that I still don't like about ClickOnce is if you put out an
update and don't
make it a required update and the user clicks "No" when prompted, they never get
prompted again (it should have a choice for the prompt, like "not this
time" or "Don't remind me").

I simply make every update required :). They are very quick. It is
very similar to launching
a batch file and copying over an mdb if needed.

The other thing that I do is keep a copy of all of my MS required
files on our servers and make our
bootstrappers point to our servers rather than MS. I don't want MS
changing a link on me, or replacing
a file with a newer version (without us first testing it) then
breaking my app. They tend to do that in the CE world.

To tell you the truth I don't remember where I've created my SDFs from.
I've converted older SDFs to the current format using this function:

    Private Sub UpdateSDF()
        UpDateCaption("Updating SDF: Converting SDF from SQL CE 3.0 to 3.5")
        'Physically update the SDF from SQLCE3.0/3.1 to 3.5
        Dim engine As SqlServerCe.SqlCeEngine = New
SqlServerCe.SqlCeEngine("Data Source=" & MomsUpdPath & SDFfile)
        engine.Upgrade("Data Source=" & MomsUpdPath & SDFfile & ";")
        SdfHasBeenModified = True
    End Sub

You won't be able to actually upload data, or get far in the app
without an iPAQ device connected,
but If you'd like to see how the app runs and sets up the prereqs, you
can go here and run the


Prior to finding out how to do all of this, we had several setup files.
One for XP, One for 32bit Vista/7, another for 64 bit. Now everything
is all done with one setup.
So much more nicer.


On Fri, Oct 29, 2010 at 11:13 AM, Shamil Salakhetdinov
<shamil at smsconsulting.spb.ru> wrote:
> Thank you, David,
> But for Click-Once is a PITA to have some custom files installed together
> with application? (I have many such files).
> So, I can just use Click-Once bootstrapping to setup SQL Server CE 3.5 SP1.
> Did you try to use MS SQL 2008 R2 databases with SQL Server CE 3.5 SP1, or
> SQL Server CE 3.5 SP1 databases are just the ones created and managed within
> Visual Studio solutions and then distributed together with such a solution
> setup kit? (I have never used SQL Server CE)
> Thank you.
> --
> Shamil
> -----Original Message-----
> From: dba-vb-bounces at databaseadvisors.com
> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of David McAfee
> Sent: 29 ??????? 2010 ?. 22:01
> To: Discussion concerning Visual Basic and related programming issues.
> Subject: Re: [dba-VB] SQL Server Compact 3.5
> I used it on Mobile devices.
> I developed a ClickOnce VB.Net Launcher app that our users run to copy the
> SDF from the mobile device over to the PC.
> The VB app then pulls datasets (invoices) from the SDF using ADO.Net and
> passes them to a web service. Different datasets (customer updates, New
> "wishlist orders", Item updates) are also returned via the web service and
> inserted into the SDF. The SDF is then copied back to the mobile device.
> Users of older versions (CF 2.0, 3.0) are also converted to 3.5 on the fly
> via my app.
> I had to write some custom Bootstrappers to detect if the correct
> prequisites were installed.
> The prerequisites are:
> Windows Installer 3.1
> .Net Framework 3.5 SP1
> MS ActiveSync 4.5 (if using WinXP)
> Windows Mobile Device Center (If Vista/7, 32 bit) Windows Mobile Device
> Center x64 (If Vista/7, 64 bit) SQL Server CE 3.5 SP1 (X86) SQL Server CE
> 3.5 SP1 (X64)
> I didn't like Click once at first as I thought it was very limited.
> After finding out about writing Bootstrappers, I was much more happier with
> it.
> On Fri, Oct 29, 2010 at 2:09 AM, Shamil Salakhetdinov
> <shamil at smsconsulting.spb.ru> wrote:
>> Hi All --
>> Did you work with MS SQL Server 3.5 Compact edition?
>> http://www.microsoft.com/sqlserver/2008/en/us/compact.aspx
>> Will that work with MS SQL Server 2008 R2 databases?
>> How do you distribute your application using MS SQL Server 3.5 Compact
>> edition? (Yes, all the info on distrobuting MS SQL Server 3.5 based
>> apps is on Internet but I have never worked with it and I hope you
>> have some hints to get up&running here ASAP)
>> Thank you.
>> --
>> Shamil
>> _______________________________________________
>> dba-VB mailing list
>> dba-VB at databaseadvisors.com
>> http://databaseadvisors.com/mailman/listinfo/dba-vb
>> http://www.databaseadvisors.com
> _______________________________________________
> dba-VB mailing list
> dba-VB at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-vb
> http://www.databaseadvisors.com
> _______________________________________________
> dba-VB mailing list
> dba-VB at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-vb
> http://www.databaseadvisors.com

More information about the dba-VB mailing list