SQLServer CE Files

  • Thread starter Thread starter Atley
  • Start date Start date
A

Atley

Is is possible to copy a SQLServerCE database file (.sdf) to a desktop and
through VB.net access the data held within? If so, do I need to install any
special DLL set? I know that there is a SQLServerCE driver that installs on
the Windows Mobile devices, but is there one for the desktop?

The reason I ask this, is that I want to build an application that will
allow me to get certain information off the device's data file without
having to have a full-blown SQL Server and going through the issues
concerned with setting up syncronization.


Thanks for the info, I am just trying to assess the viability of making this
application this way, and I am wondering if anyone has done it before?
 
SQL Server 2005 Mobile Edition is designed with this in mind.
You will not be able to programmatically work with SQL Server 2000 CE
Edition
database files on the desktop from VB.NET.

Best bet would be to serialize your .SDF file to XML, send it to the
desktop,
and work with it in that format.
 
This should really be posted to:

microsoft . public . sqlserver . ce

It's not really a CF issue.
 
Actually it is a Compact Framework question, since the solution involves
using the Compact Framework to convert the SDF file to a text format. ;-)
 
Hi.

Actually, SQL Server CE can be seen as a .sdf monolithical file with a .DLL
wrapper on it. It is not a real "service", just a DLL offering some
functionality reachable only from the device. For that reason, among others,
you cannot access the data directly from outside as a regular client-server
database.

Perhaps you can use XML to manipulate datasets back and forth, using XML
facilities already built-in the .NET CF. You can use XML web services to
accomplish this task, remember that the datasets performs many of the
conversion and they're transmitted and consumed without (almost) further
processing. This, of course, involves the deployment of an HTTP server on
the server (desktop) side. If you haven´t one, perhaps you can try to
generate XML documents in the device's filesystem, and then transfer them to
the conventional Windows machine, in this case even ActiveSync could be
useful if you carefully plan your XML-files naming convention. The data is
pushed from the device to the server side.

If you can transfer all the file at once, I think a simpler and homemade
solution -without using an HTTP server- *could* be this one:

1. At your device, create an XML document -on the filesystem- by translating
the .sdf file content by using regular .NET CF datasets and using
mydataset.XMLWrite method. The XML document must be written on \My Documents
folder to be visible to Activesync.
2. establish an activesync connection to your server. this has the advantage
that no HTTP server is needed, but if you plan to sync remotely thru
internet some problems could arise. If you are using an internet connection,
you must connect first to the network, and then initiate the Activesync
activity from the device. If you configure from the server the file to be
transmitted, you can automatically transfer the XML document to a folder on
the server side.
3. Once on the server side, you can read the XML document (think it as a
huge dataset with many datatables in it) and process the data accordingly.
The smartest decision can be to use .NET framework on the desktop side, but
you can use also Visual FoxPro, since it supports also .NET datasets
manipulating facilities.

This approach has a drawback, however: the dataset must be held in memory,
but the XML file on the device's filesystem also occupies RAM. Because the
files' sync process is between \My Documents folder in your device and a
designated folder on your desktop machine, I'm not sure if adding and SD to
your device can solve this RAM problem, because the \Storage Card folder
could remain unreachable to the ActiveSync file sync process.

Hope this can help, Im' sure there could be another smarter solution, and
please excuse me for my poor english.

Carlos Alejandro Pérez
Argentina
MVP .NET CF
 
You don't need a FULL SQL 2000 server. SQLCE will replicate to the MSDE
(SQL Desktop Edition) but it requires alot of t-sql. You have to script
your publications as well as the database. You can use Enterpirse Manager
to generate scripts from a full blown install, then use your setup program
to configure MSDE. I am working on just such a solution now for smaller
companies that don't need to layout for SQL 2000 Standard.

Just remember that you would still need to install and config SQLCE dlls on
IIS on that machine.

z
 
Back
Top