PC Review


Reply
Thread Tools Rate Thread

Data Access Application Block/Nested Dataset/Transactions

 
 
John Zink
Guest
Posts: n/a
 
      25th Jul 2003
I am in the process of writing some WEB Services that will
receive a nested Dataset and have to apply any changes to
the appropriate tables. I am planning on using the Data
Access Application Block for my database calls. I have
the UpdateDataset method working, but now I want to add
transactional support. If the dataset contains changes to
table1, table2, and table3 I want to wrap the updates in a
transaction so I can roll back if necessary.
Any ideas on how the application block handles this ?
Do I have to modify the application block and add my own
custom code ?
 
Reply With Quote
 
 
 
 
Peter Gossmann
Guest
Posts: n/a
 
      27th Jul 2003
I extended the Data Access Application Block to be able to fill
datasets (also typed datasets, with TableMapping) and to update tables
from the Dataset. I use a "Select" Stored Procedure and the other
Commands (Update, Insert, Delete) are created by a Command Builder.

Its not 100% clean, but if you are interested i could mail you the
code. It works like this:
- create a DataAdapter
- Build the Commands
- call .Update on the DataAdapter for a given DataTable

As the method accepts a Transaction and a Connection object as
parameter you can run updates on several tables sequentially and then
commit the transaction.

Here is the signature of the method in the SQLHelper:

public static void UpdateDataTable(SqlConnection connection,
SqlTransaction transaction, System.Data.CommandType selectCommandType,
string selectCommandText, DataTable dataTable, DataTableMapping[]
tableMapping)

Peter Gossmann
MCP for ASP.NET


"John Zink" <(E-Mail Removed)> wrote in message news:<09f501c352bc$2fc49ed0$(E-Mail Removed)>...
> I am in the process of writing some WEB Services that will
> receive a nested Dataset and have to apply any changes to
> the appropriate tables. I am planning on using the Data
> Access Application Block for my database calls. I have
> the UpdateDataset method working, but now I want to add
> transactional support. If the dataset contains changes to
> table1, table2, and table3 I want to wrap the updates in a
> transaction so I can roll back if necessary.
> Any ideas on how the application block handles this ?
> Do I have to modify the application block and add my own
> custom code ?

 
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
Access nested child data within a dataset =?Utf-8?B?U3RldmUgVGVlcGxlcw==?= Microsoft C# .NET 3 4th May 2006 07:51 AM
Filling a strongly-typed dataset using Data Access Application Block (DAAB) June2005 Version Bart_Tubalinal@hmco.com Microsoft ADO .NET 4 20th Sep 2005 12:59 AM
Data Access Application Block v3.0: How to fill DataSet with multi tables feng Microsoft ADO .NET 1 5th Oct 2004 04:08 PM
Data Access Application Block =?Utf-8?B?TWFyaw==?= Microsoft ADO .NET 5 11th Mar 2004 10:44 AM
Populating a Typed DataSet with the MS Data Application Block Mike Best Microsoft ADO .NET 1 21st Feb 2004 12:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:49 PM.