Mike,
Your diagram is roughly what I'm doing except I'm not using ODBC to connect
to the DBF data on the desktop. I'm actually using PInvoke from a C# app to
exported functions in a DLL I wrote that accesses the data since the data is
not created using the Foxpro product but instead something similar. In any
case, there is a Foxpro OleDb provider that I have tested that would
probably be a good choice for you.
Since my desktop app manages extracting the data to download, creating the
SDF file, copying the SDF file to the device, then copying the SDF file back
from the device and inserting the data into the desktop DBF files, all under
my programmatic control, there really haven't been any major issues. The
main thing to watch out for is being sure when you want to delete the device
SDF file, which you can also do using Rapi. With DBF files where you are
inserting data while the data is also in use multi-user by other users or
processes, you need to make sure that whatever tool you use to do this is
compatible at the index level. I don't expect you'd encounter any problems
using the Foxpro OleDb provider sharing data with a Foxpro application, but
you should test to make sure.
One other tip you might find useful is that I ended up actually working with
two SDF files on the device rather than one, since reference data
(customers, products, etc.) might not need to be refreshed as often as you'd
want to upload transactions from the device. Similarly, the desktop
application also has an option to download the device-side application,
CABs, etc. as well as the option to put everything on a storage card or not.

Signature
Ginny Caughey
Device Application Development MVP
www.wasteworks.com
Scalehouse and Billing Software for Waste Management
> On Feb 27, 11:28 am, fod...@gmail.com wrote:
>> Hello,
[quoted text clipped - 38 lines]
>
> Mike
fodsuk@gmail.com - 27 Feb 2008 16:33 GMT
On Feb 27, 3:58 pm, "Ginny Caughey [MVP]"
<ginny.caughey.onl...@wasteworks.com> wrote:
> Mike,
>
[quoted text clipped - 77 lines]
>
> > Mike
Hi Ginny,
Sorry i did mean Ole instead of Odbc.
Im just working on a example of this system.
One question i have is... what method did you use
to "Sync" the data from the .dbf to the .sdf
my first idea was to download the .dbf information to an multi
dimensional ArrayList
and then read through that ArrayList and create the .sdf
There are possible problems with this and the ArrayList could be
considered
the "third Database" in the equation.
its probably the only way, i'm just wondering if you had a better
method
Thanks,
Mike
Ginny Caughey [MVP] - 27 Feb 2008 17:02 GMT
Mike,
I work with the DBF data directly on the desktop to create the SDF file. I
use SqlCeResultSet to insert data. As I read each record I need from the DBF
file, I insert it into the SQLce table, then skip to the next record in the
DBF file and repeat. It would be similar to using a DataReader to walk
though data using ADO.NET or an AdoResultSet in ADO.

Signature
Ginny Caughey
Device Application Development MVP
www.wasteworks.com
Scalehouse and Billing Software for Waste Management
> On Feb 27, 3:58 pm, "Ginny Caughey [MVP]"
> <ginny.caughey.onl...@wasteworks.com> wrote:
[quoted text clipped - 116 lines]
>
> Mike
fodsuk@gmail.com - 29 Feb 2008 12:19 GMT
Hello Ginny,
I have had my head buried in a sample app
hence the lack of replies :).
Rather then going through the DataReader route of reading
each row of results.
did you look into doing some sort of Extract and Dump the results as a
table
into the Sqlce database?
from my premiliary research it doesn't seem possible, did you come
across this?
Kind Regards,
Mike
Ginny Caughey [MVP] - 29 Feb 2008 13:05 GMT
Mike,
I didn't take that approach for a couple of reasons. The main reason was
that I never wanted the whole table. That's actually pretty common with
mobile apps - you just want a subset of the enterprise data on them no
matter what technology you use on both layers. I aso wanted to massage the
data a bit and in some cases de-normalize it for better performance on the
device, so the tables in the SDF file don't match those on the desktop
precisely.
And the second reason is that even if I could bulk dump the data from the
DBF files that would be faster than extracting it record by record, there's
no fast bulk insert for SQL Compact for loading it. You can improve
performance, if it's an issue, by not building the indexes until after you
load the data and by loading the data in transactions that are some group of
rows > 1 and less than a whole table, but that's about it. The biggest
performance gain overall for my customers was giving them the option to
build and download new SQL Compact tables from reference data that changes
infrequently only when they choose to do that while still allowing them to
upload the relatively few inserts and updates while that data is fresh.

Signature
Ginny Caughey
Device Application Development MVP
www.wasteworks.com
Scalehouse and Billing Software for Waste Management
> Hello Ginny,
>
[quoted text clipped - 14 lines]
>
> Mike