<?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>LINQ to SQL and One-To-Many Relationships</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx</link><description>Recently a customer sent me a question related to the video I posted on creating a one-to-many form with LINQ to SQL . In that video I use the Northwind database to set up a one-to-many association between the Customers and Orders entities. We all love</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Techy News Blog &amp;raquo; LINQ to SQL and One-To-Many Relationships</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx#5249729</link><pubDate>Wed, 03 Oct 2007 02:51:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5249729</guid><dc:creator>Techy News Blog » LINQ to SQL and One-To-Many Relationships</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.artofbam.com/wordpress/?p=4710"&gt;http://www.artofbam.com/wordpress/?p=4710&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: LINQ to SQL and One-To-Many Relationships</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx#5340338</link><pubDate>Sun, 07 Oct 2007 15:13:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5340338</guid><dc:creator>Eulinky</dc:creator><description>&lt;p&gt;Thanks Beth for that great post. Hope the &amp;quot;DeleteOnNull&amp;quot; property can be set from the Designer in the final version...&lt;/p&gt;
</description></item><item><title>re: LINQ to SQL and One-To-Many Relationships</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx#5372767</link><pubDate>Tue, 09 Oct 2007 01:30:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5372767</guid><dc:creator>Jason Crosby</dc:creator><description>&lt;p&gt;This is great stuff but I'm still getting stuck. &amp;nbsp;Anyone else getting the error:&lt;/p&gt;
&lt;p&gt;Overload resolution failed because no accessible 'New' accepts this number of arguments&lt;/p&gt;
&lt;p&gt;After modifying the .dbml file?&lt;/p&gt;
&lt;p&gt;The error is in this line, Private db As New DropShipClassesDataContext.&lt;/p&gt;
&lt;p&gt;This error remains even when I remove the added DeleteOnNull=&amp;quot;true&amp;quot; text from the .dbml file.&lt;/p&gt;
&lt;p&gt;Prior to editing the .dbml file the project compiles and everything on the form works fine (of course I can't delete rows from the order grid).&lt;/p&gt;
&lt;p&gt;I've tried this with multiple projects and datasources so I would think someone else must be running into this as well.&lt;/p&gt;
&lt;p&gt;Beths code and database is the only one I can get working with out the error.&lt;/p&gt;
&lt;p&gt;TIA to anyone who can offer some insight into this.&lt;/p&gt;
</description></item><item><title>re: LINQ to SQL and One-To-Many Relationships</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx#5383388</link><pubDate>Tue, 09 Oct 2007 18:58:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5383388</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Jason,&lt;/p&gt;
&lt;p&gt;In Beta 2 when you create the instance of the DataContext, pass it the connection string from your My.Settings, something like:&lt;/p&gt;
&lt;p&gt;Dim db As New DropShipClassesDataContext(My.Settings.MyConnectionString)&lt;/p&gt;
&lt;p&gt;HTH,&lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
</description></item><item><title>re: LINQ to SQL and One-To-Many Relationships</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx#5386259</link><pubDate>Wed, 10 Oct 2007 01:02:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5386259</guid><dc:creator>Jason Crosby</dc:creator><description>&lt;p&gt;That's it Beth, thanks again.&lt;/p&gt;
&lt;p&gt;I don't know if the comments area is the right place for these questions, just let me know if there is a more appropriate place.&lt;/p&gt;
&lt;p&gt;When pressing the delete button I can’t find a way to stop the delete from happening. &amp;nbsp;I’d like to prompt the user with If MsgBox(&amp;quot;Are you sure you want to delete?&amp;quot;, MsgBoxStyle.YesNo, &amp;quot;Delete?&amp;quot;) = MsgBoxResult.No Then Exit Sub&lt;/p&gt;
&lt;p&gt;Inside the click event of the delete button. The delete happens even if the user clicks no. &amp;nbsp;It seems as soon as the Sub ends the delete happens no matter where you exit/end the Sub.&lt;/p&gt;
</description></item><item><title>re: LINQ to SQL and One-To-Many Relationships</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx#5387132</link><pubDate>Wed, 10 Oct 2007 03:22:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5387132</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Jason, &lt;/p&gt;
&lt;p&gt;You can clear out the delete button's default behavior by selecting the BindingNavigator toolstrip and clearing out the DeleteItem behavior. Then you can create your own handler by double-clicking the delete button. When you want to actually delete the item, just call the BindingSource's RemoveCurrent method. &lt;/p&gt;
&lt;p&gt;You can also check out the VB Forums here: &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;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
</description></item><item><title>re: LINQ to SQL and One-To-Many Relationships</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx#5866865</link><pubDate>Sat, 03 Nov 2007 23:13:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5866865</guid><dc:creator>Julie Lerman</dc:creator><description>&lt;p&gt;Thanks. I'll be using this in my linq session at DevConnections! :-)&lt;/p&gt;
</description></item><item><title>re: LINQ to SQL and One-To-Many Relationships</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx#7117580</link><pubDate>Tue, 15 Jan 2008 14:07:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7117580</guid><dc:creator>Adam</dc:creator><description>&lt;p&gt;Hey Beth.&lt;/p&gt;
&lt;p&gt;Hows the weather in San Fransisco?&lt;/p&gt;
&lt;p&gt;Great artical.&lt;/p&gt;
&lt;p&gt;You can also use DeleteOnSubmit() as an alternative. Either reference back to the original DataContext or if it isn't available, use Attatch() to attatch the item to a new context.&lt;/p&gt;
&lt;p&gt;e.g.&lt;/p&gt;
&lt;p&gt;DbDataContext _db;&lt;/p&gt;
&lt;p&gt;protected override void OnInit(EventArgs e) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; _db = new DbDataContext();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; ...&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; base.OnInit(e);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;protected override void Dispose() {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; _db.Dispose();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; base.Dispose();&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;void Delete(object sender, EventArgs args) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;...&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;_db.Products.DeleteOnSubmit(product);&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
</description></item><item><title>Creating Lookup Lists with LINQ to SQL</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx#7520982</link><pubDate>Thu, 07 Feb 2008 20:36:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7520982</guid><dc:creator>Noticias externas</dc:creator><description>&lt;p&gt;In yesterday&amp;amp;#39;s post I showed you how to bind LINQ to SQL classes to a Combobox in order to filter&lt;/p&gt;
</description></item><item><title>One-To-Many (Master-Detail) Forms with LINQ to SQL</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx#7804904</link><pubDate>Wed, 20 Feb 2008 02:11:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7804904</guid><dc:creator>Beth Massi - Sharing the goodness that is VB</dc:creator><description>&lt;p&gt;In my previous posts here and here I showed how to use LINQ to SQL classes with a couple different Combobox&lt;/p&gt;
</description></item><item><title>Creating Lookup Lists with LINQ to SQL</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx#7897790</link><pubDate>Tue, 26 Feb 2008 04:16:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7897790</guid><dc:creator>Beth Massi - Sharing the goodness that is VB</dc:creator><description>&lt;p&gt;In yesterday's post I showed you how to bind LINQ to SQL classes to a Combobox in order to filter records&lt;/p&gt;
</description></item><item><title>re: LINQ to SQL and One-To-Many Relationships</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx#8965821</link><pubDate>Fri, 26 Sep 2008 04:43:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8965821</guid><dc:creator>MatthewY</dc:creator><description>&lt;p&gt;Awesome, Had the same issue and came accross this posting. Fixed. Shame that its not in the designer :-(&lt;/p&gt;
</description></item><item><title>LINQ to SQL: DeleteOnNull</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx#8972197</link><pubDate>Thu, 02 Oct 2008 00:01:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8972197</guid><dc:creator>Dave Brace</dc:creator><description>&lt;p&gt;My first project at Catalyst just wrapped up this past week, and it involved creating an order fulfillment&lt;/p&gt;
</description></item><item><title>re: LINQ to SQL and One-To-Many Relationships</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx#9408825</link><pubDate>Mon, 09 Feb 2009 18:41:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9408825</guid><dc:creator>Cheryl</dc:creator><description>&lt;p&gt;I have just started using LINQ and everything worked fine until I wanted to put in the combo box. &lt;/p&gt;
&lt;p&gt;I am getting a string to double conversion error. Any ideas on how I correct this. My table uses an &amp;quot;int&amp;quot; &lt;/p&gt;
&lt;p&gt;Thanks in advance for any help&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Dim teamList = From Bowler In Db.Bowlers _&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; Where Bowler.TeamNumber &amp;lt;&amp;gt; &amp;quot;&amp;quot; _&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; Order By Bowler.TeamNumber _&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; Select Bowler.TeamNumber&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;For Each TeamNumber In teamList&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Me.ToolStripComboBox1.Items.Add(TeamNumber)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Next&lt;/p&gt;</description></item><item><title>re: LINQ to SQL and One-To-Many Relationships</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx#9409054</link><pubDate>Mon, 09 Feb 2009 21:20:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9409054</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Cheryl,&lt;/p&gt;
&lt;p&gt;If TeamNumber is an integer you cannot compare its value to a empty string. If it's a nullable field then try &amp;quot;Where Bowler.TeamNumber IsNot Nothing&amp;quot; otherwise you'll need to compare it to an integer value. &lt;/p&gt;
&lt;p&gt;You also may want to try the LINQ to SQL forums: &lt;a rel="nofollow" target="_new" href="http://social.msdn.microsoft.com/forums/en-US/linqtosql/threads"&gt;http://social.msdn.microsoft.com/forums/en-US/linqtosql/threads&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: LINQ to SQL and One-To-Many Relationships</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx#9409081</link><pubDate>Mon, 09 Feb 2009 21:38:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9409081</guid><dc:creator>Cheryl</dc:creator><description>&lt;p&gt;Thank you for answering. I was able to get work by using the code below. I works well now. I really enjoy your videos. They are clear and concise. I have learned a lot. Thank you. &lt;/p&gt;
&lt;p&gt;Dim teamList = (From Bowler In Db.Bowlers _&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; &amp;nbsp; &amp;nbsp;Where Bowler.TeamNumber &amp;lt;&amp;gt; 0 _&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; &amp;nbsp; &amp;nbsp;Order By Bowler.TeamNumber _&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; &amp;nbsp; &amp;nbsp;Select Bowler.TeamNumber).Distinct()&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;For Each TeamNumber In teamList&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Me.ToolStripComboBox1.Items.Add(TeamNumber)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Next&lt;/p&gt;</description></item><item><title>re: LINQ to SQL and One-To-Many Relationships</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx#9409102</link><pubDate>Mon, 09 Feb 2009 21:58:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9409102</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Cheryl,&lt;/p&gt;
&lt;p&gt;Distinct is a Keyword in VB so you could also write it this way to be more clear:&lt;/p&gt;
&lt;p&gt;Dim teamList = From Bowler In Db.Bowlers _&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; &amp;nbsp; Where Bowler.TeamNumber &amp;lt;&amp;gt; 0 _&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; &amp;nbsp; Order By Bowler.TeamNumber _&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; &amp;nbsp; Select Bowler.TeamNumber Distinct&lt;/p&gt;
&lt;p&gt;HTH,&lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
</description></item><item><title>re: LINQ to SQL and One-To-Many Relationships</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx#9644410</link><pubDate>Wed, 27 May 2009 16:35:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9644410</guid><dc:creator>Bassam</dc:creator><description>&lt;p&gt;Hello Beth,&lt;/p&gt;
&lt;p&gt;this works for entities that came from db , but if i added new row to the details in the grid &amp;nbsp;then delete that row before i submit changes , i still got the same error&lt;/p&gt;
&lt;p&gt;i tried everything i could but still , no solution, any help is desparately needed and greatly appreciated&lt;/p&gt;
&lt;p&gt;thank you&lt;/p&gt;
&lt;p&gt;Bassam&lt;/p&gt;</description></item><item><title>re: LINQ to SQL and One-To-Many Relationships</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx#9686746</link><pubDate>Tue, 02 Jun 2009 23:23:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9686746</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Bassam,&lt;/p&gt;
&lt;p&gt;I'm not seeing this behavior with the sample I attached to the post. I tried adding a new order in the detail grid, moving off the row (to commit it to the datasource) and then highlighting the row again and pressing the delete key. When I click save, I do not get an error. Can you verify these steps with the sample: &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/bethmassi/attachment/5246895.ashx"&gt;http://blogs.msdn.com/bethmassi/attachment/5246895.ashx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
</description></item><item><title>re: LINQ to SQL and One-To-Many Relationships</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx#9725414</link><pubDate>Thu, 11 Jun 2009 03:21:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9725414</guid><dc:creator>Gunnar</dc:creator><description>&lt;p&gt;Thanks for good information. Just got &amp;quot;An attempt was made to remove a relationship between...&amp;quot; error fixed in my library code. :)&lt;/p&gt;</description></item><item><title>re: LINQ to SQL and One-To-Many Relationships</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx#9792243</link><pubDate>Sat, 20 Jun 2009 01:08:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9792243</guid><dc:creator>argg</dc:creator><description>&lt;p&gt;Thanks! You've saved me much hearache.&lt;/p&gt;</description></item><item><title>re: LINQ to SQL and One-To-Many Relationships</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx#9850684</link><pubDate>Tue, 28 Jul 2009 09:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9850684</guid><dc:creator>Andrei</dc:creator><description>&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;It works.&lt;/p&gt;
&lt;p&gt;It's a shame its not in the designer.&lt;/p&gt;</description></item><item><title>re: LINQ to SQL and One-To-Many Relationships</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx#9925746</link><pubDate>Thu, 19 Nov 2009 21:01:37 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9925746</guid><dc:creator>Paul Hodgson</dc:creator><description>&lt;p&gt;I think there's a typo in this:-&lt;/p&gt;
&lt;p&gt;For instance, if we bind the LINQ to SQL classes to two grids, delete just the child Order row, and attempt to call SubmitChanges(), we get the following error &amp;quot;An attempt was made to remove a relationship between a Customer and a Order. However, one of the relationship's foreign keys (Order.CustomerID) cannot be set to null.&amp;quot;&lt;/p&gt;
&lt;p&gt;Surely, adn according to the screenshot, should this actually read &amp;quot;...delete just the parent Customer row...&amp;quot;?&lt;/p&gt;
&lt;p&gt;Which is a shame as I am getting the offending error message when I attempt to delete a child and the fixes mentioned here don't help.&lt;/p&gt;
</description></item><item><title>re: LINQ to SQL and One-To-Many Relationships</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx#9925756</link><pubDate>Thu, 19 Nov 2009 21:15:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9925756</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Paul,&lt;/p&gt;
&lt;p&gt;No, the article is correct. I'm showing what happens if you try to delete the child row that has a non-null FK reference to its parent. Make sure in your situation that you're applying the DeleteOnNull attribute to the right association in the XML. Otherwise maybe there is another association involved? You may want to check out th LINQ to SQL forums as well:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://social.msdn.microsoft.com/Forums/en-US/linqtosql/threads"&gt;http://social.msdn.microsoft.com/Forums/en-US/linqtosql/threads&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: LINQ to SQL and One-To-Many Relationships</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx#9925764</link><pubDate>Thu, 19 Nov 2009 21:26:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9925764</guid><dc:creator>Paul Hodgson</dc:creator><description>&lt;p&gt;Hi Beth&lt;/p&gt;
&lt;p&gt;Awesome quick response and yes you are correct. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Although I followed your example and I still got an error message I failed to notice that the error message had indeed changed. &amp;nbsp;Basically validation on the class was thowing exception. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Cheers and my apologies regards my assumptions.&lt;/p&gt;
</description></item><item><title>re: LINQ to SQL and One-To-Many Relationships</title><link>http://blogs.msdn.com/bethmassi/archive/2007/10/02/linq-to-sql-and-one-to-many-relationships.aspx#9925769</link><pubDate>Thu, 19 Nov 2009 21:34:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9925769</guid><dc:creator>Beth Massi</dc:creator><description>&lt;p&gt;Hi Paul,&lt;/p&gt;
&lt;p&gt;No worries, glad you figured it out! And thanks for reading my blog... ;-)&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;-B&lt;/p&gt;
</description></item></channel></rss>