<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>TableAdapters and Transactions</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/11/tableadapters-and-transactions.aspx</link><description>In my last post I showed you how to save related parent-child DataTables in proper update, insert and delete order by controlling how the TableAdapters saved the rows. In this next post I'll demonstrate how we can do this inside a database transaction.</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Beth Massi - Sharing the goodness that is VB : Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/11/tableadapters-and-transactions.aspx#3925874</link><pubDate>Wed, 18 Jul 2007 02:27:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3925874</guid><dc:creator>Beth Massi - Sharing the goodness that is VB : Working with TableAdapters and Related DataTables</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx"&gt;http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: TableAdapters and Transactions</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/11/tableadapters-and-transactions.aspx#3963723</link><pubDate>Fri, 20 Jul 2007 01:59:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3963723</guid><dc:creator>Graham Edwards</dc:creator><description>&lt;p&gt;I am very new to all this data adapter stuff and I think your videos and blogs are great, but I am stuck on one thing to do with related tables and it is driving me crazy. Can you help me? Plllllease????&lt;/p&gt;
&lt;p&gt;I need to simply update an invoice header and invoice item table, but I am getting an error giving me a foreign key violation (HEADERID in item table) even though I have followed your procedures. &lt;/p&gt;
&lt;p&gt;Here is my code can you tell me where i am going wrong? As I said HEADERID in the header is related to HEADERID in the item table.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Dim o_InvoiceDataService As New DataService.Invoices&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Dim lobjHeader As New DataService.InvoicesTableAdapters.GDax_AuditInvoiceHeaderTableAdapter&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lobjHeader.SetConnectionString(My.Settings.cash_sheetConnectionString)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lobjHeader.Fill(o_InvoiceDataService.GDax_AuditInvoiceHeader)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Dim lobjItem As New DataService.InvoicesTableAdapters.GDax_AuditInvoiceItemTableAdapter&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lobjItem.SetConnectionString(My.Settings.cash_sheetConnectionString)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lobjItem.Fill(o_InvoiceDataService.GDax_AuditInvoiceItem)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' Declare a variable named newInvoicesHeaderRow of type HeaderRow.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Dim newInvoicesHeaderRow As DataService.Invoices.GDax_AuditInvoiceHeaderRow&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' Assign the new HeaderRow that is returned to the newInvoicesHeaderRow variable.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;newInvoicesHeaderRow = o_InvoiceDataService.GDax_AuditInvoiceHeader.NewGDax_AuditInvoiceHeaderRow&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' ***** Set the value of the columns in the new HeaderRow. ******&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;newInvoicesHeaderRow.ACCOUNT_REF = &amp;quot;PP&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' ***** Add the new HeaderRow to the HeaderDataTable ******&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;o_InvoiceDataService.GDax_AuditInvoiceHeader.AddGDax_AuditInvoiceHeaderRow(newInvoicesHeaderRow)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' Declare a variable named newInvoicesItemRow of type ItemRow.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Dim newInvoicesItemRow As DataService.Invoices.GDax_AuditInvoiceItemRow&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' Assign the new ItemRow that is returned to the newInvoicesItemRow variable.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;newInvoicesItemRow = o_InvoiceDataService.GDax_AuditInvoiceItem.NewGDax_AuditInvoiceItemRow&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' ***** Set the value of the columns in the new ItemRow. ******&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;newInvoicesItemRow.NET_AMOUNT = 46&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;' ***** Add the new ItemRow to the ItemDataTable ******&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;o_InvoiceDataService.GDax_AuditInvoiceItem.AddGDax_AuditInvoiceItemRow(newInvoicesItemRow)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lobjHeader.Update(o_InvoiceDataService.GDax_AuditInvoiceHeader)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;lobjItem.Update(o_InvoiceDataService.GDax_AuditInvoiceItem)&lt;/p&gt;
</description></item><item><title>re: TableAdapters and Transactions</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/11/tableadapters-and-transactions.aspx#4032751</link><pubDate>Tue, 24 Jul 2007 22:43:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4032751</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Graham,&lt;/p&gt;
&lt;p&gt;You need to make sure that the relation is set up properly on your DataSet as I explain here: &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx"&gt;http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is because when you insert a new parent, the database fills its primary key and that key needs to be filled in the child's foreign key field before the child row is inserted. ADO.NET will do this for you (between the update statements) if you set up your relation properly, indicating that it's a FK constraint and to Cascade updates and deletes.&lt;/p&gt;
&lt;p&gt;HTH,&lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
</description></item><item><title>re: TableAdapters and Transactions</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/11/tableadapters-and-transactions.aspx#4085670</link><pubDate>Fri, 27 Jul 2007 23:05:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4085670</guid><dc:creator>Graham Edwards</dc:creator><description>&lt;p&gt;Thankyou very much. I looked at your videos again and solved all my problems. I have been looking for weeks for a site like yours.&lt;/p&gt;
&lt;p&gt;I think it is fantastic and feel confidence in using all these new features in the right way.&lt;/p&gt;
&lt;p&gt;I just wish I had come across it sooner, would have saved me hours of wasted time trying to get things to work. &lt;/p&gt;
</description></item><item><title>Forms Over Data Video Series - Two More Videos Released</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/11/tableadapters-and-transactions.aspx#4178985</link><pubDate>Thu, 02 Aug 2007 02:47:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4178985</guid><dc:creator>Beth Massi - Sharing the goodness that is VB</dc:creator><description>&lt;p&gt;I just released two more videos ( #15 , #16 ) in the Forms Over Data video series . One is on understanding&lt;/p&gt;
</description></item><item><title>re: TableAdapters and Transactions</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/11/tableadapters-and-transactions.aspx#4584884</link><pubDate>Mon, 27 Aug 2007 07:38:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4584884</guid><dc:creator>Warren</dc:creator><description>&lt;p&gt;Great series!! I really love the Forms Over Data videos. Very informative especially for a somelike like me which came from access and vb6.&lt;/p&gt;
&lt;p&gt;I have been making a payroll project and the series has been my guide and im wondering if you can help me with one problem. &amp;nbsp;I have a parent detail dataset which i have related properly. &amp;nbsp;And i have created a update stored procedure for both the parent and detail table which has a &amp;quot;Where (PayrollID = @PID) And (EmployeeID = @EID) And (TableRowView = @Original_TableRowView)&amp;quot; clause on the timestamp column. &amp;nbsp;I followed the above transaction. The problem is i always get a concurrency error when i save the detail table. &amp;nbsp;If i comment out the timestamp Where clause it updates succesffuly. &amp;nbsp;Any ideas?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
</description></item><item><title>re: TableAdapters and Transactions</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/11/tableadapters-and-transactions.aspx#4639927</link><pubDate>Thu, 30 Aug 2007 07:58:40 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4639927</guid><dc:creator>Bob Bergan</dc:creator><description>&lt;p&gt;The TransactionScope example fails for me. &amp;nbsp;I'm using Express. &amp;nbsp;Is that the reason? &amp;nbsp;Any way around it? &amp;nbsp;I'll provide specifics, if you like, or is Express hopeless for Transaction processing?&lt;/p&gt;
</description></item><item><title>re: TableAdapters and Transactions</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/11/tableadapters-and-transactions.aspx#4818876</link><pubDate>Sat, 08 Sep 2007 03:21:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4818876</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Bob,&lt;/p&gt;
&lt;p&gt;SQL- Express should work. Make absolutely sure that the connection reference is the same for all your TableAdapters. &lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
</description></item><item><title>re: TableAdapters and Transactions</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/11/tableadapters-and-transactions.aspx#4819028</link><pubDate>Sat, 08 Sep 2007 03:35:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4819028</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Warren,&lt;/p&gt;
&lt;p&gt;Make sure that your Update statement also contains a ;SELECT after it to reselect the updated timestamp back into the DataSet. This should happen automatically when you use the designer. i.e.&lt;/p&gt;
&lt;p&gt;UPDATE [dbo].[Customer] SET [LastName] = @LastName, [FirstName] = @FirstName, [Address] = @Address, [City] = @City, [State] = @State, [ZIP] = @ZIP WHERE (([CustomerID] = @Original_CustomerID) AND ([Modified] = @Original_Modified));&lt;/p&gt;
&lt;p&gt;SELECT CustomerID, LastName, FirstName, Address, City, State, ZIP, Modified FROM Customer WHERE (CustomerID = @CustomerID)&lt;/p&gt;
&lt;p&gt;HTH,&lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
</description></item><item><title>re: TableAdapters and Transactions</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/11/tableadapters-and-transactions.aspx#4864913</link><pubDate>Tue, 11 Sep 2007 15:55:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4864913</guid><dc:creator>Warren</dc:creator><description>&lt;p&gt;thanks for the response, unfortunately the detail part is still not updating. the Master record seems to be updating fine but the whole transaction rollback because the detail is not updating. &amp;nbsp;I tried using the designer generated code but still get a exception saying a concurrency violation, the update command affeced 0 of the expected 1 record. &amp;nbsp;If i leave out the timestamp field from the where clause on the detail records the updates succeeds. &amp;nbsp;Any ideas?&lt;/p&gt;
&lt;p&gt;Warren&lt;/p&gt;
</description></item><item><title>re: TableAdapters and Transactions</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/11/tableadapters-and-transactions.aspx#4872485</link><pubDate>Wed, 12 Sep 2007 02:54:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4872485</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Warren, &lt;/p&gt;
&lt;p&gt;Does it work if you don't use stored procs and instead just use the TableAdapter designer generated insert/update/delete statements?&lt;/p&gt;
</description></item><item><title>re: TableAdapters and Transactions</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/11/tableadapters-and-transactions.aspx#4923559</link><pubDate>Sat, 15 Sep 2007 08:37:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4923559</guid><dc:creator>Warren</dc:creator><description>&lt;p&gt;Hi beth,&lt;/p&gt;
&lt;p&gt;Using the table generated adapter designer statements also fails to update, - &amp;quot;concurrency violation, the update command affected 0 of the expected 1 record.&amp;quot; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Warren&lt;/p&gt;
</description></item><item><title>re: TableAdapters and Transactions</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/11/tableadapters-and-transactions.aspx#5125630</link><pubDate>Tue, 25 Sep 2007 20:52:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5125630</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Warren,&lt;/p&gt;
&lt;p&gt;Does the sample application attached to this post work for you? Are you using a timestamp field in SQL server or are you using a datetime? &lt;/p&gt;
&lt;p&gt;I would open a trace in SQL profiler and watch the update statement. It sounds like the database row is being updated before your dataset's row is updated. Is it possible you have a trigger firing somewhere?&lt;/p&gt;
&lt;p&gt;You also may want to ask your question on the forums because more people may be able to respond. &lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://forums.microsoft.com/msdn/default.aspx?forumgroupid=10&amp;amp;siteid=1"&gt;http://forums.microsoft.com/msdn/default.aspx?forumgroupid=10&amp;amp;siteid=1&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: TableAdapters and Transactions</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/11/tableadapters-and-transactions.aspx#5184014</link><pubDate>Fri, 28 Sep 2007 13:50:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5184014</guid><dc:creator>Warren</dc:creator><description>&lt;p&gt;Hi Beth,&lt;/p&gt;
&lt;p&gt;Yes your example works perfectly but your example does not use store proc. to update the tables and yes i'm using timestamp fields. &amp;nbsp;I haved looked at the SQL profiler and although the update fails the timestamps get updated. Anyway thank you so much for taking time to respond to my questions. I wil check out the forum... &lt;/p&gt;
&lt;p&gt;More power,&lt;/p&gt;
&lt;p&gt;Warren&lt;/p&gt;
</description></item><item><title>re: TableAdapters and Transactions</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/11/tableadapters-and-transactions.aspx#5205374</link><pubDate>Sun, 30 Sep 2007 06:26:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5205374</guid><dc:creator>Warren</dc:creator><description>&lt;p&gt;Hi Beth,&lt;/p&gt;
&lt;p&gt;Dang, I finnaly solved it!!! hahaha... stupid rookie mistake!!!. &amp;nbsp;It was the Cascade update on the primary key that was breaking the transaction. &amp;nbsp;I have a text based document number which i use as primary key and in my update sp updates this col which then cascade updates the details table and changes thier timestamp col hence the concurrency error. I rewrote the sp to not update the document no. which in the first place should never have been editable after inserting and the update transaction now works!! hehehe.&lt;/p&gt;
&lt;p&gt;Thank you so much beth, would never have done it without you. &amp;nbsp;Your form over data video series have been really a great help for me coming from vb6.access. &amp;nbsp;More power to you..&lt;/p&gt;
&lt;p&gt;Warren&lt;/p&gt;
</description></item><item><title>re: TableAdapters and Transactions</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/11/tableadapters-and-transactions.aspx#6017456</link><pubDate>Fri, 09 Nov 2007 16:45:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6017456</guid><dc:creator>Everton</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;if I insert (in a new order) more than one product the line below starts a infinite loop and raises an overflow exception.&lt;/p&gt;
&lt;p&gt;&amp;quot;For Each detail As Order_DetailsRow In details&amp;quot;&lt;/p&gt;
&lt;p&gt;(method Order_DetailsDataTable_ColumnChanged, file OrdersDataSet.vb)&lt;/p&gt;
&lt;p&gt;What could be wrong?&lt;/p&gt;
&lt;p&gt;I am using VS2005 and SqlServer2005 Express. &lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
</description></item><item><title>re: TableAdapters and Transactions</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/11/tableadapters-and-transactions.aspx#6622971</link><pubDate>Sat, 01 Dec 2007 06:10:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6622971</guid><dc:creator>Sam</dc:creator><description>&lt;p&gt;Hi Beth,&lt;/p&gt;
&lt;p&gt;First of all, I would said that this article is excellent and thank god that I found this website.&lt;/p&gt;
&lt;p&gt;I seems not to be able to solve the dbconcurrency or &amp;nbsp;the delete and update - &amp;quot;update command affected 0 of the expected 1 record.&amp;quot; &amp;nbsp;problems when working with related Tables.&lt;/p&gt;
&lt;p&gt;I followed your previous(first part) of this article and my problems seems to go away at least for now but that problem seems to come back occasionally. I will received that error occasionally when start working only with new inserted records.&lt;/p&gt;
&lt;p&gt;I would like to implement this second part of tutorial but I'm working with MS Access Database. Maybe you could post an article similar to this but intended for MS Access Database.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Sam&lt;/p&gt;
</description></item><item><title>re: TableAdapters and Transactions</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/11/tableadapters-and-transactions.aspx#6971048</link><pubDate>Thu, 03 Jan 2008 22:24:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6971048</guid><dc:creator>Ed</dc:creator><description>&lt;p&gt;Hi Beth:&lt;/p&gt;
&lt;p&gt;Wow, you certainly understand dataadapters! &amp;nbsp;I too am having issues with &amp;quot;Concurrency violation: the UpdateCommand affected 0 of the expected 1 records&amp;quot; and only occurs when I add a new row to my dataset and attempt to use the Update method on my dataadapter. &amp;nbsp;I have read about 20 different resolutions to this problem but none of them seem to apply to my situation. &amp;nbsp;I did add a partial class to trap the RowUpdated event on the data adapter so that I could insert the Primary Key value into my dataset (using a Stored Procedure on SQL Server 2005) but that didn't solve my problem either. &amp;nbsp;I am running out of solutions on resolving this problem and it's probably something benign and not obvious.&lt;/p&gt;
</description></item><item><title>re: TableAdapters and Transactions</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/11/tableadapters-and-transactions.aspx#7019518</link><pubDate>Mon, 07 Jan 2008 23:12:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7019518</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Ed,&lt;/p&gt;
&lt;p&gt;If the parent fails to insert correctly then the child will also fail. It's important to do this inside a transaction like I explain above so that the integrity of your data stays intact. To troubleshoot the exact problem use SQL Profiler to see if there are failing triggers or other messages being returned from your database. &lt;/p&gt;
&lt;p&gt;HTH,&lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
</description></item><item><title>The New TableAdapterManager in Visual Studio 2008</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/11/tableadapters-and-transactions.aspx#7023477</link><pubDate>Tue, 08 Jan 2008 06:53:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7023477</guid><dc:creator>Beth Massi - Sharing the goodness that is VB</dc:creator><description>&lt;p&gt;In my previous post on TableAdapters and Transactions I showed a couple techniques on how to perform&lt;/p&gt;
</description></item><item><title>The New TableAdapterManager in Visual Studio 2008</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/11/tableadapters-and-transactions.aspx#7023642</link><pubDate>Tue, 08 Jan 2008 07:14:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7023642</guid><dc:creator>Noticias externas</dc:creator><description>&lt;p&gt;In my previous post on TableAdapters and Transactions I showed a couple techniques on how to perform&lt;/p&gt;
</description></item><item><title>re: TableAdapters and Transactions</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/11/tableadapters-and-transactions.aspx#7978533</link><pubDate>Sat, 01 Mar 2008 18:49:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7978533</guid><dc:creator>Terry Chng</dc:creator><description>&lt;p&gt;May i know is that any way to do this in vb.net 2003, the concept and the purpose is totally what i want to do but i using the visual studio 2003. Please help up... Your help are highly appreciated.&lt;/p&gt;
</description></item><item><title>re: TableAdapters and Transactions</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/11/tableadapters-and-transactions.aspx#8337672</link><pubDate>Wed, 26 Mar 2008 15:56:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8337672</guid><dc:creator>somashekar </dc:creator><description>&lt;p&gt;content is fantastic. it help me a lot , thank you Beth Missi&lt;/p&gt;
</description></item><item><title>re: TableAdapters and Transactions</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/11/tableadapters-and-transactions.aspx#9249078</link><pubDate>Tue, 23 Dec 2008 06:01:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9249078</guid><dc:creator>Ben Curnow</dc:creator><description>&lt;p&gt;Thanks Beth,&lt;/p&gt;
&lt;p&gt;I have been trying for ages to implement batch transactions but none of the MS examples use strongly typed datasets and I could never work out how to set the transaction object. &amp;nbsp;I never would have thought of partial classes.&lt;/p&gt;
&lt;p&gt;Now my users won't keep getting upset because the data is inconsistent.&lt;/p&gt;
&lt;p&gt;Ben&lt;/p&gt;</description></item><item><title>re: TableAdapters and Transactions</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/11/tableadapters-and-transactions.aspx#9538318</link><pubDate>Wed, 08 Apr 2009 17:48:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9538318</guid><dc:creator>Ian</dc:creator><description>&lt;p&gt;Thanks for this piece of Code. &amp;nbsp;All other options I have seen are written in C#. &amp;nbsp;I had to modify it for oracle which was easy. &amp;nbsp; I did run into one problem which had me stumped for a few hours. &amp;nbsp;I am using custom insert commands and it kept giving me an obscure error. &amp;nbsp;I finally adapted the code for the partial class to following:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Dim CC_CNT As Integer&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Me.Connection = conn&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;If trans IsNot Nothing Then&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Me.Adapter.InsertCommand.Transaction = trans&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Me.Adapter.DeleteCommand.Transaction = trans&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Me.Adapter.UpdateCommand.Transaction = trans&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;For CC_CNT = 0 To Me.CommandCollection.Length - 1&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Me.CommandCollection(CC_CNT).Transaction = trans&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Next&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End If&lt;/p&gt;
&lt;p&gt;This put transaction on all the commands in the command collections as well as the generic update/insert and delete. &amp;nbsp;Hope this helps others&lt;/p&gt;</description></item></channel></rss>