PC Review


Reply
Thread Tools Rate Thread

Datasets and transactions (SQL CE)

 
 
wooz
Guest
Posts: n/a
 
      4th May 2005
Hi !
I have few datasets, all of them works on the same connection (SQL CE
server). I do some opeations on these datasets and then call an "update"
method on each one.
How to update all datasets transactionally ? For example:

ds1 - dataset
ds2 - dataset
ds3 - dataset

ds1.Tables(0).update - OK
ds2.Tables(0).update - OK
ds3.Tables(0).update - Fail

In this case all changes made by ds1 and ds2 should be rolled up.


Thanks in advance.

 
Reply With Quote
 
 
 
 
Darren Shaffer
Guest
Posts: n/a
 
      5th May 2005
You can create and begin a transaction on your single connection to the SQL
CE
database, but this transaction must be included in each command used to
update the underlying tables in SQL CE. Depending on the approach you
have taken with your SqlCeDataAdapter you may have to move away from
using SqlCeCommandBuilder (which automatically provides your select, insert,
update, delete commands) and provide your own four command objects
for your adapters and include this one transaction in all but the select
commands.
Of course you must ensure that the same connection on which you started
the transaction is used for all three dataset updates.

--
Darren Shaffer
..NET Compact Framework MVP
Principal Architect
Connected Innovation
www.connectedinnovation.com

"wooz" <(E-Mail Removed)> wrote in message
news:d5bk8e$aal$(E-Mail Removed)...
> Hi !
> I have few datasets, all of them works on the same connection (SQL CE
> server). I do some opeations on these datasets and then call an "update"
> method on each one.
> How to update all datasets transactionally ? For example:
>
> ds1 - dataset
> ds2 - dataset
> ds3 - dataset
>
> ds1.Tables(0).update - OK
> ds2.Tables(0).update - OK
> ds3.Tables(0).update - Fail
>
> In this case all changes made by ds1 and ds2 should be rolled up.
>
>
> Thanks in advance.
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Transactions in ADO.NET typed datasets -TransactionScope or DbTransaction micklang@gmail.com Microsoft ADO .NET 1 16th Apr 2007 04:40 PM
How do Datasets manage to get deserialized as DataSets instead of a wsdl.exe-created proxy class? news.microsoft.com Microsoft ASP .NET 0 12th Apr 2006 10:07 AM
Transactions and Typed DataSets, Adapters (Visual Studio 2005) Mike Smith Microsoft ADO .NET 1 19th Nov 2005 03:59 AM
Re: DataSets, RowStates and Transactions W.G. Ryan eMVP Microsoft Dot NET 1 9th Nov 2004 04:16 PM
Mixing ADO.NET transactions and Stored Procedure Transactions James Walker Microsoft ADO .NET 1 27th May 2004 11:09 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:14 PM.