<?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>Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx</link><description>This past couple weeks I've been asked to help out a few people in the community work through a couple snags they were having with respect to the TableAdapters and how they should work in a multi-user application when updating related parent-child tables.</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>TableAdapters and Transactions</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#3821942</link><pubDate>Thu, 12 Jul 2007 03:34:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3821942</guid><dc:creator>Beth Massi - Sharing the goodness that is VB</dc:creator><description>&lt;p&gt;In my last post I showed you how to save related parent-child DataTables in proper update, insert and&lt;/p&gt;
</description></item><item><title>Link Listing - July 11, 2007</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#3824163</link><pubDate>Thu, 12 Jul 2007 06:13:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3824163</guid><dc:creator>Christopher Steen</dc:creator><description>&lt;p&gt;Announcing the LunchTimerCoder.com Initiative [Via: Chris Pietschmann ] Building a PC, Part I [Via:...&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/10/working-with-tableadapters-related-datatables-and-transactions.aspx#4178984</link><pubDate>Thu, 02 Aug 2007 02:47:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4178984</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: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#4281524</link><pubDate>Tue, 07 Aug 2007 21:50:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4281524</guid><dc:creator>katiebird</dc:creator><description>&lt;p&gt;Hi Beth,&lt;/p&gt;
&lt;p&gt;I've been enjoying your series and trying to follow using my own database.&lt;/p&gt;
&lt;p&gt;I'm getting an error about trying to convert a 1-dimensional array of system.data.datarow to a system.data.datarow -- AND I can't get past it.&lt;/p&gt;
&lt;p&gt;Do you have any idea where I might be goofing up?&lt;/p&gt;
&lt;p&gt;In the Meantime, I'll redo the example using Northwind. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for the series, it's terrific!&lt;/p&gt;
</description></item><item><title>re: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#4323445</link><pubDate>Fri, 10 Aug 2007 20:55:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4323445</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Katiebird,&lt;/p&gt;
&lt;p&gt;I can't tell what's wrong unless you post the code. Sounds like you have some erroneous parentheses after your DataRow variable. You might want to ask this question on the forums: &lt;a rel="nofollow" target="_new" href="http://forums.microsoft.com/msdn/showforum.aspx?forumid=32&amp;amp;siteid=1"&gt;http://forums.microsoft.com/msdn/showforum.aspx?forumid=32&amp;amp;siteid=1&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
</description></item><item><title>Using Data Across Multiple Windows Forms</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#5227195</link><pubDate>Mon, 01 Oct 2007 22:44:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5227195</guid><dc:creator>Beth Massi - Sharing the goodness that is VB</dc:creator><description>&lt;p&gt;Recently I've had more than a few questions about how to handle working with data across multiple forms.&lt;/p&gt;
</description></item><item><title>re: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#6600437</link><pubDate>Thu, 29 Nov 2007 20:05:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6600437</guid><dc:creator>Larson</dc:creator><description>&lt;p&gt;Hi Beth,&lt;/p&gt;
&lt;p&gt;I'm working through your FormsOverData series as an intro to SQL Server. I love it - I wish something like this had been around when I was cutting my teeth with Access!&lt;/p&gt;
&lt;p&gt;I thought I had my head around Parent-Child Relationships, then I ran into this problem with referential integrity which I can reproduce very easily using your OMS application.&lt;/p&gt;
&lt;p&gt;If I take Form2 from your OrderManager3 project, and enable referential integrity, it still all works fine. However, if I comment out the Fill calls in Form2_Load, then add a Button which does this:-&lt;/p&gt;
&lt;p&gt;Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Me.CustomerTableAdapter.FillByGetOne(Me.CustomerOrdersDataSet.Customer)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Me.OrdersTableAdapter.Fill(Me.CustomerOrdersDataSet.Orders)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;End Sub&lt;/p&gt;
&lt;p&gt;[FillByGetOne just gets the Customer record where CustomerID = 1]&lt;/p&gt;
&lt;p&gt;So, I'm just pulling one Cust record down, but the Fill for the OrdersTableAdapter fails with an integrity violation. I'm really puzzled as to why. I'm sure its something very simple but I can't figure it out, even from your excellent series of videos.&lt;/p&gt;
&lt;p&gt;Thanks for reading this.&lt;/p&gt;
</description></item><item><title>re: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#6600910</link><pubDate>Thu, 29 Nov 2007 21:48:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6600910</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Larson,&lt;/p&gt;
&lt;p&gt;When you enable referential integrity on the dataset that means the for every child there MUST be a parent. You need to make sure to only pull the records down for that same one customer on the orders table as well. Take a look at this video on how to handle saving as well: &lt;a rel="nofollow" target="_new" href="http://msdn2.microsoft.com/en-us/vbasic/bb725826.aspx"&gt;http://msdn2.microsoft.com/en-us/vbasic/bb725826.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;HTH,&lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
</description></item><item><title>re: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#6614336</link><pubDate>Fri, 30 Nov 2007 14:32:28 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6614336</guid><dc:creator>Larson</dc:creator><description>&lt;p&gt;Of course, I see that now. My mistake was that just because I only *see* the Orders belonging to a single Customer, I'd assumed that's all that was being brought down. But of course it's not. All the Order records come down, and what I see is controlled by the BindingAdapter. &amp;nbsp;Correct?&lt;/p&gt;
&lt;p&gt;Thanks for the invaluable pointers as always.&lt;/p&gt;</description></item><item><title>re: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#6725904</link><pubDate>Mon, 10 Dec 2007 20:46:39 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6725904</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Larson,&lt;/p&gt;
&lt;p&gt;You can control what records are returned by adding a paramertized query on the TableAdapter. I show how to do that here: &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/bethmassi/archive/2007/05/25/creating-a-parameterized-query.aspx"&gt;http://blogs.msdn.com/bethmassi/archive/2007/05/25/creating-a-parameterized-query.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
</description></item><item><title>re: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#6791775</link><pubDate>Mon, 17 Dec 2007 22:05:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6791775</guid><dc:creator>George Gomez</dc:creator><description>&lt;p&gt;Please I need A form with the code ro sendd emial anywhere&lt;/p&gt;
</description></item><item><title>The New TableAdapterManager in Visual Studio 2008</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#7023480</link><pubDate>Tue, 08 Jan 2008 06:53:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7023480</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/10/working-with-tableadapters-related-datatables-and-transactions.aspx#7023646</link><pubDate>Tue, 08 Jan 2008 07:15:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7023646</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: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#7600602</link><pubDate>Mon, 11 Feb 2008 07:38:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7600602</guid><dc:creator>Don Tinsley</dc:creator><description>&lt;p&gt;I am banging my head against the wall trying to correctly get VB 2008 to update a related table. &amp;nbsp;My form/data are setup almost identical to how they were in both 'updating related tables' vidoes. &amp;nbsp;My problem is that when I add a record, the primary key of the parent stays -1 and perpetuates to the child. &amp;nbsp;So when the tableadaptermanager updates with the dataset, the parent is put in and assigned a new (autonumber) id, but the child table rows are put in with -1 as the id. &amp;nbsp;I am using Access 2003 and don't know if that is the problem.&lt;/p&gt;
</description></item><item><title>re: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#7615466</link><pubDate>Mon, 11 Feb 2008 20:13:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7615466</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Don,&lt;/p&gt;
&lt;p&gt;I'm not an Access developer but I do know that it's a bit of work inserting rows since Access does not support batch SQL statements. What the TableAdapters do for you when you create your DataSets against SQL Server is they generate an additional statement after the INSERT command that is used to retrieve the SCOPE_IDENTITY(). &lt;/p&gt;
&lt;p&gt;In Access (using the Jet Provider 4.0) you will need to issue a separate command (SELECT @@IDENTITY) after each row is inserted in order to retrieve the identity. You can do this by adding a handler in each TableAdapter to the _adapter.RowUpdated.&lt;/p&gt;
&lt;p&gt;Here's some information that may help explain: &lt;a rel="nofollow" target="_new" href="http://msdn2.microsoft.com/en-us/library/ms971502.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms971502.aspx&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;HTH,&lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
</description></item><item><title>re: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#8362901</link><pubDate>Sun, 06 Apr 2008 15:13:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8362901</guid><dc:creator>Ben</dc:creator><description>&lt;p&gt;testing... last post didn't appear...&lt;/p&gt;
</description></item><item><title>re: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#8362924</link><pubDate>Sun, 06 Apr 2008 15:23:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8362924</guid><dc:creator>Ben</dc:creator><description>&lt;p&gt;Ok that's weird. &amp;nbsp;I posted this message before and it didn't appear (I got redirected to your homepage), but my previous test post did work... Anyway, here goes again...&lt;/p&gt;
&lt;p&gt;Firstly, Beth, great article. &amp;nbsp;Exactly what I've been looking for, thanks!&lt;/p&gt;
&lt;p&gt;I had not set relations in the dataset designer to cascade integrity, and was hence struggling with parent/child relationships being lost after executing tableadapter.update() on the parent table.&lt;/p&gt;
&lt;p&gt;Now I'm past that, can you help with my next problem please? &amp;nbsp;I'm guessing I'm doing something silly...&lt;/p&gt;
&lt;p&gt;Basically, after inserting the parent row, I try to insert the child row (which appears to now be correctly referencing its parent).&lt;/p&gt;
&lt;p&gt;However, the transaction commits ok, but the child record is nowhere to be seen in the SQL database (the parent is visible there). &amp;nbsp;Do you know what I'm doing wrong?&lt;/p&gt;
&lt;p&gt;On the last couple of attempts to post, I included a code summary... but left it out this time in the hope that my message gets accepted.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Ben.&lt;/p&gt;
</description></item><item><title>re: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#8362961</link><pubDate>Sun, 06 Apr 2008 15:54:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8362961</guid><dc:creator>Ben</dc:creator><description>&lt;p&gt;I've worked out why the second update - childTableTableAdapter.update(ds.childRow) - isn't working. &lt;/p&gt;
&lt;p&gt;It looks as though the first update for the parent row - parentTableTableAdapter.update(ds.parentRow) - causes the rowstate on the child row to change from &amp;quot;added&amp;quot; to &amp;quot;unchanged&amp;quot;.&lt;/p&gt;
&lt;p&gt;I've no idea why that's happening though. &amp;nbsp;Any thoughts?&lt;/p&gt;
</description></item><item><title>re: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#8363051</link><pubDate>Sun, 06 Apr 2008 16:52:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8363051</guid><dc:creator>Ben</dc:creator><description>&lt;p&gt;Hmmm. &amp;nbsp;Rank amateur. &lt;/p&gt;
&lt;p&gt;I had Accept/Reject rule on the relationship set to cascade as well...&lt;/p&gt;
&lt;p&gt;Thanks again for getting me headed in the right direction!!&lt;/p&gt;
</description></item><item><title>re: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#8414974</link><pubDate>Mon, 21 Apr 2008 19:53:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8414974</guid><dc:creator>Dermot Heslin</dc:creator><description>&lt;p&gt;Hi Beth, &lt;/p&gt;
&lt;p&gt;Thanks for this article - it was very helpful in setting up related DataTables in my current project.&lt;/p&gt;
&lt;p&gt;One point that might be helpful for developers - if you're not using drag-and-drop databinding, you need to link the related records in code using &amp;lt;childrow&amp;gt;.SetParentRow(&amp;lt;parentrow&amp;gt;). Took me a while to figure that out!&lt;/p&gt;
</description></item><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/10/working-with-tableadapters-related-datatables-and-transactions.aspx#8567371</link><pubDate>Sun, 01 Jun 2008 10:02:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8567371</guid><dc:creator>Dating</dc:creator><description>&lt;p&gt;This past couple weeks I've been asked to help out a few people in the community work through a couple snags they were having with respect to the TableAdapters and how they should work in a multi-user application when updating related parent-child tables&lt;/p&gt;
</description></item><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/10/working-with-tableadapters-related-datatables-and-transactions.aspx#8576576</link><pubDate>Fri, 06 Jun 2008 03:11:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8576576</guid><dc:creator>Weddings</dc:creator><description>&lt;p&gt;This past couple weeks I've been asked to help out a few people in the community work through a couple snags they were having with respect to the TableAdapters and how they should work in a multi-user application when updating related parent-child tables&lt;/p&gt;
</description></item><item><title>re: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#8648971</link><pubDate>Tue, 24 Jun 2008 23:40:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8648971</guid><dc:creator>Asaf</dc:creator><description>&lt;p&gt;Great article! I have not succueded to find a good explenation on this confusing subject until found your one.&lt;/p&gt;
&lt;p&gt;thanks a lot&lt;/p&gt;
</description></item><item><title>re: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#8702085</link><pubDate>Mon, 07 Jul 2008 17:55:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8702085</guid><dc:creator>Frans van Ek</dc:creator><description>&lt;p&gt;Hi beth,&lt;/p&gt;
&lt;p&gt;thanks for all your video's, I've learned a lot from them. I'm currently combining the video's to work with a middle tier and updating related tables. &lt;/p&gt;
&lt;p&gt;(i've created a tool to generate the webservice from the datamanager so they are always in sink) i think it's cool.&lt;/p&gt;
&lt;p&gt;one thing i'm a bit confused about, is when you say you dont want to load the whole table in the dataset when you don't need all of the data.&lt;/p&gt;
&lt;p&gt;I can understand that. So in the query we make a filtering using a @parameter. But wat is the best way to get the related childs loaded in the related child table.&lt;/p&gt;
&lt;p&gt;Do we have to loop through the parent table and load the corresponding childs? perhaps not with a loop but triggert by an event?&lt;/p&gt;
&lt;p&gt;Or is the best way to create a fill method on the childtable wich is based on same filter as we've used to fill the parenttable?&lt;/p&gt;
&lt;p&gt;thanks again&lt;/p&gt;
&lt;p&gt;Frans &lt;/p&gt;
</description></item><item><title>re: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#8762477</link><pubDate>Mon, 21 Jul 2008 22:57:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8762477</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Frans,&lt;/p&gt;
&lt;p&gt;When developing a distributed application you always need to balance the number of calls you are making to your middle-tier with the amount of data you want to return. In general, it's better to bring down a larger set of data than to make multiple repeated calls to the middle-tier. This is because even the simple act of making the call can be expensive. So looping may not be the best way to go about it.&lt;/p&gt;
&lt;p&gt;However, you definitely don't want to clog the wire with a lot of data especially if you don't really need it on the client. &lt;/p&gt;
&lt;p&gt;So you need to look for the right balance by doing perf and load testing. Try to break down each entity into a manageable set of data and test the performance and scalability. For instance you may have a form that works with a single order and its order details. That would probably be a reasonable set of data to bring down in one call.&lt;/p&gt;
&lt;p&gt;Also take a look at caching lookup tables and other read-only data on the client to help scalability. There's an easy way to add local caching to the client in VS2008. Here's a video on that technology: &lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/en-us/vbasic/cc307991.aspx"&gt;http://msdn.microsoft.com/en-us/vbasic/cc307991.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;HTH,&lt;/p&gt;
&lt;p&gt;-Beth&lt;/p&gt;
</description></item><item><title>re: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#9374398</link><pubDate>Sun, 25 Jan 2009 02:07:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9374398</guid><dc:creator>Nurlan</dc:creator><description>&lt;p&gt;Hi Beth,&lt;/p&gt;
&lt;p&gt;I am developing an app with Visual c#. But I am stuck at this point:&lt;/p&gt;
&lt;p&gt;System.Data.SqlClient.SqlCommandBuilder cb;&lt;/p&gt;
&lt;p&gt;cb = new System.Data.SqlClient.SqlCommandBuilder(daNI);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DataRow dRow = dsNI.Tables[&amp;quot;TaskNI&amp;quot;].NewRow();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dRow[1] = taskTitle;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dRow[2] = taskText;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dRow[3] = taskDate;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;dsNI.Tables[&amp;quot;TaskNI&amp;quot;].Rows.Add(dRow);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;daNI.Update(dsNI, &amp;quot;TaskNI&amp;quot;);&lt;/p&gt;
&lt;p&gt;So this is my code. My database table has 5 columns 1st and 2nd tables are primary and foreign keys respectively. &amp;nbsp;3rd and 4th columns are nullable&lt;/p&gt;
&lt;p&gt;Error says: connection cannot be initiated. But when i tried to insert string where it should be datetime it recognizes that that column has to be datetime. So i think problem is arising from updating primary and foreign keys. How do we update foreign key?&lt;/p&gt;
&lt;p&gt;thanx&lt;/p&gt;</description></item><item><title>re: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#9419076</link><pubDate>Fri, 13 Feb 2009 18:44:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9419076</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Nurlan,&lt;/p&gt;
&lt;p&gt;If the error says that the connection cannot be initiated then it's something wrong with the database connection. Check your connection string and make sure you've assigned a connection to the data adapter.&lt;/p&gt;
&lt;p&gt;HTH,&lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
</description></item><item><title>re: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#9432030</link><pubDate>Wed, 18 Feb 2009 21:24:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9432030</guid><dc:creator>Rachel</dc:creator><description>&lt;p&gt;Hi Beth,&lt;/p&gt;
&lt;p&gt;I followed your tutorials fine for updating two related tables (many thanks!) but am running into problems going from two to three related tables – can you help? I’m new to VB2008 and it is probably something obvious! A simple example (using the Northwind database):&lt;/p&gt;
&lt;p&gt;I drag three datagridviews onto one form: Customers (main node), Orders (related node) and Order Details (related node under Orders). &lt;/p&gt;
&lt;p&gt;Orders is a child of Customers, and Order Details is a child of Orders.&lt;/p&gt;
&lt;p&gt;I’ve created Relation and FK Constraints with Cascade Update and Delete rules for both relations. Hierarchical update is set to true. &lt;/p&gt;
&lt;p&gt;I add the following code (below) to the form, but when I run the code attempt to save a new customer with a new order and order details I get the error: ‘You cannot add or change a record because a related record is required in table ‘Orders’.&lt;/p&gt;
&lt;p&gt;Private Sub Form1_Load_(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;/p&gt;
&lt;p&gt;Me.CustomersTableAdapter.Fill(Me.NwindDataSet.Customers)&lt;/p&gt;
&lt;p&gt;Me.OrdersTableAdapter.Fill(Me.NwindDataSet.Orders)&lt;/p&gt;
&lt;p&gt;Me.Order_DetailsTableAdapter.Fill(Me.NwindDataSet.Order_Details)&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;Private Sub OrdersBindingSource_AddingNew(ByVal sender As Object, ByVal e As System.ComponentModel.AddingNewEventArgs) Handles OrdersBindingSource.AddingNew&lt;/p&gt;
&lt;p&gt;Me.CustomersBindingSource.EndEdit()&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;Private Sub Order_DetailsBindingSource_AddingNew(ByVal sender As Object, ByVal e As System.ComponentModel.AddingNewEventArgs) Handles Order_DetailsBindingSource.AddingNew&lt;/p&gt;
&lt;p&gt;Me.OrdersBindingSource.EndEdit()&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;Private Sub CustomersBindingSourceBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CustomersBindingSourceBindingNavigatorSaveItem.Click&lt;/p&gt;
&lt;p&gt;Me.Validate()&lt;/p&gt;
&lt;p&gt;Me.CustomersBindingSource.EndEdit()&lt;/p&gt;
&lt;p&gt;Me.OrdersBindingSource.EndEdit()&lt;/p&gt;
&lt;p&gt;Me.Order_DetailsBindingSource.EndEdit()&lt;/p&gt;
&lt;p&gt;Me.TableAdapterManager.UpdateAll(Me.NwindDataSet)&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;</description></item><item><title>re: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#9491159</link><pubDate>Fri, 20 Mar 2009 00:16:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9491159</guid><dc:creator>james p</dc:creator><description>&lt;p&gt;Hi &lt;/p&gt;
&lt;p&gt;Wondered if you ever managed to resolve this problem? &amp;nbsp;I found that when working with three or more related tables that i couldn't get the TableAdapterManager to work.&lt;/p&gt;
&lt;p&gt;My only workaround was sending in the updates, changes and deletes in code as you had to in vb2005 (before the TableAdapterManager was created). &amp;nbsp;&lt;/p&gt;
&lt;p&gt;I used the code from Beth's video here&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/en-us/vbasic/bb725826.aspx"&gt;http://msdn.microsoft.com/en-us/vbasic/bb725826.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;i came into even more problems trying to do all this across different forms and keeping them all in sync!&lt;/p&gt;</description></item><item><title>re: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#9597828</link><pubDate>Sat, 09 May 2009 00:28:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9597828</guid><dc:creator>Kris</dc:creator><description>&lt;p&gt;I too have had trouble using the tableadapter to update multiple related tables all at once! I'm really hoping there is some sort of easy &amp;quot;duhhh&amp;quot; thing going on here because i dont want to have to manually code everything. Althought at this point, after a month of chugging through possible issues...im about ready to do it. Has ANYONE figured out how to get the tableadaptermanager to work using three or more (nested) related tables?&lt;/p&gt;</description></item><item><title>re: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#9617077</link><pubDate>Fri, 15 May 2009 00:11:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9617077</guid><dc:creator>Waner Michaud</dc:creator><description>&lt;p&gt;Hi Beth,&lt;/p&gt;
&lt;p&gt;Can you guide me on how to get &amp;nbsp;a child form to save along with the record that I parsed from a parent form..&lt;/p&gt;
&lt;p&gt;the parent form is registration form, from the registration record to open a case form.&lt;/p&gt;
&lt;p&gt;Please look at the codes below:&lt;/p&gt;
&lt;p&gt;Private Sub OpenCaseFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenCaseFile.Click&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Dim c5 As New Cases&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;c.Reg_IDLabel1.Text = Me.Reg_IDLabel1.Text&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;c.Complainant_IDLabel1.Text = Me.Complainant_IDComboBox.Text&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;c.Offender_IDLabel1.Text = Me.Offender_IDComboBox.Text&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;c.Commission_IDLabel1.Text = Me.Commission_IDLabel1.Text&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;c.ShowDialog()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;End Sub &lt;/p&gt;
&lt;p&gt;-----------------------------&lt;/p&gt;
&lt;p&gt;this is the save from function for the child form:&lt;/p&gt;
&lt;p&gt; Private Function Save() As Boolean&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Dim saved As Boolean = False&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;If Me.RegisCaseFileDataSet.HasChanges Then&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Try&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;'Send Adds/Updates in Parent-Child order&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Dim RegisUpdates() As DataRow = _&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.RegisCaseFileDataSet.Registration.Select(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, _&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;DataViewRowState.Added Or DataViewRowState.ModifiedCurrent)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Dim CasesUpdates() As DataRow = _&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.RegisCaseFileDataSet.Case_file.Select(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, _&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;DataViewRowState.Added Or DataViewRowState.ModifiedCurrent)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Me.RegistrationBindingSource.EndEdit()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Me.RegistrationTableAdapter.Update(RegisUpdates)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Me.ComplainantsBindingSource.EndEdit()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Me.ComplainantsTableAdapter.Update(CasesUpdates)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Me.OffendersBindingSource.EndEdit()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Me.OffendersTableAdapter.Update(CasesUpdates)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Me.CasefileBindingSource.EndEdit()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Me.Case_fileTableAdapter.Update(CasesUpdates)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;'Send Deletes in Child-Parent order&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Dim CasesDeletes() As DataRow = _&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.RegisCaseFileDataSet.Case_file.Select(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, _&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;DataViewRowState.Deleted)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Dim RegisDeletes() As DataRow = _&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.RegisCaseFileDataSet.Registration.Select(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, _&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;DataViewRowState.Deleted)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;'Child&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Me.Case_fileTableAdapter.Update(CasesDeletes)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Me.CasefileBindingSource.EndEdit()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;'Parent&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Me.RegistrationBindingSource.EndEdit()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Me.RegistrationTableAdapter.Update(RegisDeletes)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Me.ComplainantsBindingSource.EndEdit()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Me.ComplainantsTableAdapter.Update(CasesDeletes)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Me.OffendersBindingSource.EndEdit()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Me.OffendersTableAdapter.Update(CasesDeletes)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;saved = True&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Catch ex As Exception&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MsgBox(ex.ToString)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End Try&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;End If&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Return saved&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;End Function&lt;/p&gt;
&lt;p&gt;------------------&lt;/p&gt;
&lt;p&gt;I have set the relationship correctly, but I cannot get Reg_ID, Complainant_id, Offender_ID to be pushed into the case_file table..&lt;/p&gt;
&lt;p&gt;thanks,&lt;/p&gt;
&lt;p&gt;Best Regard&lt;/p&gt;</description></item><item><title>Using TableAdapters to Insert Related Data into an MS Access Database</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#9617455</link><pubDate>Fri, 15 May 2009 03:48:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9617455</guid><dc:creator>Beth Massi - Sharing the goodness that is VB</dc:creator><description>&lt;p&gt;I’ve posted before about how to use TableAdapters to update parent-child (master-detail) relationships&lt;/p&gt;
</description></item><item><title>Using TableAdapters to Insert Related Data into an MS Access Database</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#9620637</link><pubDate>Sat, 16 May 2009 04:54:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9620637</guid><dc:creator>Visual Studio Data</dc:creator><description>&lt;p&gt;I’ve posted before about how to use TableAdapters to update parent-child (master-detail) relationships&lt;/p&gt;
</description></item><item><title>re: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#9844451</link><pubDate>Wed, 22 Jul 2009 09:20:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9844451</guid><dc:creator>rpms2002</dc:creator><description>&lt;p&gt;I cannot figure out how to use the TableAdaptors to update Parent-child records when the Parent has been filtered i.e. with employees my Table Adaptor Selects employees that were not terminated.&lt;/p&gt;
&lt;p&gt;When I have a child table say EmployeeAvailability, when setting its table adaptor I have to apply the parent filter to ensure I only select child records that have a parent record selected.&lt;/p&gt;
&lt;p&gt;Now the child table adaptor will not automatically generate the Insert, Update or delete within the adaptor.&lt;/p&gt;
&lt;p&gt;Can anyone point me to some examples of how this real world scenario is handled.&lt;/p&gt;
&lt;p&gt;cheers&lt;/p&gt;
&lt;p&gt;Kieran&lt;/p&gt;</description></item><item><title>re: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#9845233</link><pubDate>Wed, 22 Jul 2009 23:32:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9845233</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi rpms,&lt;/p&gt;
&lt;p&gt;The designer cannot generate commands automatically if you are using multiple tables in your select statement. In essence you are creating a &amp;quot;view&amp;quot; of your data and because there could be many different ways to update the backend tables, the designer wouldn't know what to generate. &lt;/p&gt;
&lt;p&gt;That said, because you aren't selecting anything different in the results than columns from the child table there is a trick that you can do. &lt;/p&gt;
&lt;p&gt;Use the dataset designer to generate all the commands as you normally would when you don't specify a filter on the child table. Then go into the Properties window and select the SelectCommand.CommandText property and write your join and filter condition to the parent table. As long as you do not modify the fields that are being selected this should work. When the designer asks if you want to re-generate the update commands answer NO.&lt;/p&gt;
&lt;p&gt;HTH,&lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
</description></item><item><title>re: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#9845449</link><pubDate>Thu, 23 Jul 2009 03:05:47 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9845449</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi rpms,&lt;/p&gt;
&lt;p&gt;I wrote up a blog post on how a couple different ways you can do this real world scenario:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/bethmassi/archive/2009/07/22/filtering-child-datatables-using-tableadapters.aspx"&gt;http://blogs.msdn.com/bethmassi/archive/2009/07/22/filtering-child-datatables-using-tableadapters.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I hope this answers your question.&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
</description></item><item><title>re: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#9893274</link><pubDate>Wed, 09 Sep 2009 22:59:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9893274</guid><dc:creator>Italian Cousin</dc:creator><description>&lt;p&gt;I'm trying to make a master-detail insert in a local SQL CE database, updating through a TableAdapterManager.&lt;/p&gt;
&lt;p&gt;But I'm getting huge problems.&lt;/p&gt;
&lt;p&gt;Please help me looking here:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/e66a081c-f622-4fe7-bf56-2828f04f9f48/"&gt;http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/e66a081c-f622-4fe7-bf56-2828f04f9f48/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanx&lt;/p&gt;
</description></item><item><title>re: Working with TableAdapters and Related DataTables</title><link>http://blogs.msdn.com/bethmassi/archive/2007/07/10/working-with-tableadapters-related-datatables-and-transactions.aspx#9893283</link><pubDate>Wed, 09 Sep 2009 23:13:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9893283</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Italian Cousin,&lt;/p&gt;
&lt;p&gt;You're going to need to do something similar as Access in this case since SQL CE doesn't support batch statements. Take a look at this post for more info:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/bethmassi/archive/2009/05/14/using-tableadapters-to-insert-related-data-into-an-ms-access-database.aspx"&gt;http://blogs.msdn.com/bethmassi/archive/2009/05/14/using-tableadapters-to-insert-related-data-into-an-ms-access-database.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;HTH,&lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
</description></item></channel></rss>