Re: Challenging question

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: William Ryan eMVP (bill_at_NoSp4m.devbuzz.com)
Date: 03/28/04


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
>
>



Relevant Pages

  • Re: On DataTable, two databases
    ... informations) through the web service to hide the complexity of the data. ... Half of the columns are taken from the 1st DB (SQL Server) and the other ... I've thought about the linked server functionnalities between the two sql ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Web Service using Windows Authentication
    ... domain/login for the server. ... database access to the database your web service is using. ... >this user account in a SQL server, ...
    (microsoft.public.sqlserver.security)
  • Re: How can I start a PC program from a hand held device?
    ... There is an enormous amount of work required to get a socket server ... The only reasons you would ever want to use sockets over Web Services is for ... Create a Web Service on your server. ... Execute a stored proceedure on SQL Server (not available on SQL ...
    (microsoft.public.dotnet.framework.compactframework)
  • C# SOAP
    ... i have a handheld app which knows about a SOAP web service, ... My problem is that I want my data server to be able to talk to the ... So when the handheld connects to my server i know which wsdl file the ...
    (microsoft.public.dotnet.languages.csharp)
  • Login failed for user NT AUTHORITYANONYMOUS LOGON
    ... identity getting propagated to the SQL server. ... Windows App is on WIN XP Pro, ... Web service on a w2K3 server, using integrated authentication, web.config ...
    (microsoft.public.dotnet.distributed_apps)