Re: Challenging question
From: William Ryan eMVP (bill_at_NoSp4m.devbuzz.com)
Date: 03/28/04
- Next message: Scott M.: "Re: Closing Connection"
- Previous message: William Ryan eMVP: "OT- Just got back from MDC"
- In reply to: Calvin Lai: "Challenging question"
- Next in thread: Calvin Lai: "Re: Challenging question"
- Reply: Calvin Lai: "Re: Challenging question"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 27 Mar 2004 22:40:37 -0500
Calvin:
If I understand the problem correctly, you're asking how to keep the PDA
data in sync with what's changed on the Server since you last synced up? If
that's the question, then currently there isn't a solution (there are work
arounds but no inherent support solutions), not even on the desktop.
Remember that CE is intended to be used with Replication. You can certainly
use it as a stand alone db, but if you are using a Web Service, then I can't
imagine why you are using SQL Ce, it's just another layer of fat.
If you have a Web Service, just pull the data over from the web service and
use the DataSet as your datasource, There's no real difference b/c you
don't bind controls to CE, rahter you bind them to data returned to a
dataset from CE.. You can also serialize the dataset as soon as you pull it
over and periodically thereafter using DataSet.WriteXML(@"\filename.xml").
When the changes are ready to by submitted, just send them via the web
service. From your post, it doesn't sound like you are using replication so
I think there's All upside and no downside (even if not, the upside
outweighs the downside) to taking CE out of the equation [Mind you that I'm
a big fan of SQL Ce and not in any way saying it shouldn't be used. It's
just that if you are using a web service for data access and aren't using
replication, I don't see any benefit].
However, your real problem is how to tell what's changed? Well, ADo.NET
until v 2.0 doesn't have any native support for this. You can set up
notification services but this is totally not worth it on CE. You could
write all updates to a MessageQuue via triggers and poll the queue for
changes. This too, is a bit complex but we'll have a MessageQueue library
at www.opennetcf.org shortly and the new CF will have queuing built in and
ADO.NET 2.0 will have notifications built in.
Since neither of those is viable except in extreme situations, I'd recommend
adding a SELECT statement to each update statement and use Output
parameters. Bill Vaughn has a good example of doing this at
www.betav.com ->Articles -> MSDN.
Either that, or run a background thread with low priority that polls the db
for changes (and if you decide to use Queues like I mention above, this is
essentially what you'd do) and refreshes your dataset.
HTH,
Bill
"Calvin Lai" <clai[at]qdata[dot]com> wrote in message
news:ualWR82EEHA.2952@TK2MSFTNGP12.phx.gbl...
> Hi all,
>
> I have an unsolvable otherwise cumbersome problem. Currently I am using
> SqlCe on my Handheld w/ some data downloaded onto it from Sql Server. The
> update/insert/delete commands are then issued onto the Handheld database.
> Now with all data are changed/modified on the SqlCe, I created a
WebService
> which takes a DataSet argument and intended to update the changes made
from
> the handheld back on the consolidated Sql Server.
>
> Here comes the problem: How do I be able to generate a DataSet on the
> handheld such that it contains the modified contents since it last
> downloaded from the server? I see no way of tracking this unless I use
some
> more tables to store all the history. On the other hand, I suspect
Microsoft
> should be smart enough to provide this feature on SqlCe since it is
intended
> for remote use.
>
> Does anyone know how to solve this problem? Thanks!
>
> Calvin
>
>
- Next message: Scott M.: "Re: Closing Connection"
- Previous message: William Ryan eMVP: "OT- Just got back from MDC"
- In reply to: Calvin Lai: "Challenging question"
- Next in thread: Calvin Lai: "Re: Challenging question"
- Reply: Calvin Lai: "Re: Challenging question"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|