Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / DB Engine / SQL Server CE / February 2008

Tip: Looking for answers? Try searching our database.

SQLCE work with other databases?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
fodsuk@gmail.com - 27 Feb 2008 11:28 GMT
Hello,

I'm working on a project at work for a Logistics company. I am in the
process of developing a manifest application for a mobile  scanner
(Symbol MC3000) that runs Windows CE. I have a sample application
thats using the "SqlCeRemoteDataAccess" object. and the app connects
to a SQLCE version running on a server and extracts some data from an
SQL database and then passes it back to the database (.sdf) running on
the server.

Example code: http://csharp.paste-bin.com/13122

The clients Database is actually a FoxPro database, i was wondering if
anyone has had experience or can point me in the direction of if its a
all possible to get SQLCE objects to run with a FoxPro Database on the
server.

can SQLCE connect to a ODBC connector?

P.S. if anyone is interested, this is the URL i used to develop my
application:
http://www.ondotnet.com/pub/a/dotnet/2003/01/06/sqlce20.html?page=2

Kind regards,

Mike
Ginny Caughey [MVP] - 27 Feb 2008 12:31 GMT
Mike,

I have experience working with DBF files on the device (using the Codebase
library www.codebase.com ).

I also have one application still in production that uses SQL Compact on the
device and DBF files on the desktop. To move data between the DBF and SQLce
I have a desktop application that works with a temp SQLce database, which I
copy to/from the device using Rapi. (You can connect to SQLce on the desktop
using either OleDb or the SqlServerCe namespace depending on your
development language.) As far as I know there is no RDA type solution for
working with Foxpro data.

Signature

Ginny Caughey
Device Application Development MVP

www.wasteworks.com
Scalehouse and Billing Software for Waste Management

> Hello,
>
[quoted text clipped - 22 lines]
>
> Mike
Christian Resma Helle - 27 Feb 2008 13:03 GMT
I used the exact same setup as Ginny Caughey, except that the backend
database they used was MS Access. Microsoft provides a tool for this called
ADS, but it doesn't work on Vista so I had to make my own sync tool

If you decide to use the same approach, then I suggest you look into
OpenNETCF's Desktop Communication library instead of wrapping the Remote API
yourself (even though it is rather straight forward)

Signature

Regards,
Christian Resma Helle
http://christian-helle.blogspot.com

> Mike,
>
[quoted text clipped - 35 lines]
>>
>> Mike
fodsuk@gmail.com - 27 Feb 2008 14:37 GMT
On Feb 27, 11:28 am, fod...@gmail.com wrote:
> Hello,
>
[quoted text clipped - 21 lines]
>
> Mike

First of all, thank you both for your replies.

Ginny with regards to your application still in production,
are you able to give me a little more detail on how this works
and more direction.

from reading your explanation I gather you have the following set up:

http://www.carousel-worldwide.com/images/Scanner_DB_Solution.JPG

Any Advice/Problems you encountered would be of great help.

Kind Regards,

Mike
Ginny Caughey [MVP] - 27 Feb 2008 15:58 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.