Re: SQLCE, DataAdaptors, MultipleTables, Updates and Inserts

From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 06/21/04


Date: Mon, 21 Jun 2004 17:35:35 +0100

Paul [Paradise Solutions] <Paul@Don'tChuffingSpamMe.com> wrote:
> > Do one update and then the other, within a transaction if you want to.
> >
> > Not sure what you mean by saying that "the first adapter locks the
> > database" - I've never seen that, unless you're trying to use the same
> > connection from two different threads at the same time.
> >
>
> My First reply to this seemed to vanish, so posting again:
>
> How you mean? As in (don't mean to dumb it down - just getting me head
> round it clearly):
>
> Set multitable select query
> Fill tables
> Do table inserts/updates
> Set Insert/Update commands on adapter for table1
> Update
> Set Insert/Update commands on adapter for table2
> Update

Well, I'd suggest:

Set up adapter 1 and commands
Set up adapter 2 and commands

then later:

Fill tables
Modify tables
Open connection
Begin transaction
Set connection and transaction for commands in both adapters
Call update in adapter 1
Call update in adapter 2
Commit transaction
Close connection

-- 
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


Relevant Pages

  • Re: Re (by Cor): update DataSet - transaction
    ... I thought that I remember it me again, just setting the connection in your ... second table adapter to the same as to the first, ... Why introducing TableAdapters when transaction is not provided for them? ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: SQLCE, DataAdaptors, MultipleTables, Updates and Inserts
    ... > Set up adapter 1 and commands ... > Set connection and transaction for commands in both adapters ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: SQLCE, DataAdaptors, MultipleTables, Updates and Inserts
    ... > Set up adapter 1 and commands ... > Set connection and transaction for commands in both adapters ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: ipconfig and network connections empty - Device Manager okay
    ... adapter when the problem occurred. ... degree that in KB825826 the network connections _are_ working and just ... local area connection in the Network and Dial-up Connections folder. ... Trying to install a connection gets one to a screen where one can ...
    (microsoft.public.windowsxp.network_web)
  • Re: ipconfig and network connections empty - Device Manager okay
    ... adapter when the problem occurred. ... degree that in KB825826 the network connections _are_ working and just ... local area connection in the Network and Dial-up Connections folder. ... Trying to install a connection gets one to a screen where one can ...
    (microsoft.public.windowsxp.network_web)