The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Clarifying ADO.NET 2 Batch Updates

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
John Papa

Posts: 66
Nickname: papajohn
Registered: Apr, 2005

John Papa is .NET lead developer/architect/author
Clarifying ADO.NET 2 Batch Updates Posted: May 26, 2005 5:53 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by John Papa.
Original Post: Clarifying ADO.NET 2 Batch Updates
Feed Title: John Papa
Feed URL: /error.htm?aspxerrorpath=/blogs/john.papa/rss.aspx
Feed Description: .NET Code Samples, Data Access, Patterns and Other Musings
Latest .NET Buzz Posts
Latest .NET Buzz Posts by John Papa
Latest Posts From John Papa

Advertisement

Pablo Castro, Microsoft's Program Manager of the ADO.NET Team, has a good post last week that helps clarify how bath updates are intended to work in ADO.NET 2. This is a common discussion that I am drawn into since the DataAdapter actually invokes its command for each modified row in the DataTable that it is associated with. Thus if you have a DataTable with the following deltas:

  • 7 modified rows
  • 2 added rows
  • 2 deleted rows

The DataAdapter will invoke the UpdateCommand 7 times, the InsertCommand 2 times and the DeleteCommand 2 times for a total of 11 round trips. There are several ways to work around this, some of which Pablo points out such as sending all of the SQL statements down at once manually. You can also use diffgrams using SQL Server's XML features, too. But none of the solutions is as elegant as how ADO.NET shoulda, coulda , woulda handled it. Kudos to Pablo for a good explanation!

Read: Clarifying ADO.NET 2 Batch Updates

Topic: This blog is on semi-hiatus for the summer... Previous Topic   Next Topic Topic: Open Generic Types

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use