<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Add/Insert &amp; one to one mappings (SL)</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Add/Insert &amp; one to one mappings (SL)</description>
  <pubDate>Wed, 13 May 2026 03:48:41 -700</pubDate>
  <lastBuildDate>Fri, 31 Aug 2012 08:05:55 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=2365</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Add/Insert &amp; one to one mappings (SL) :   Originally posted by pompomJuiceAah,...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2365&amp;PID=14295#14295</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1511" rel="nofollow">olegasd</a><br /><strong>Subject:</strong> 2365<br /><strong>Posted:</strong> 31-Aug-2012 at 8:05am<br /><br /><table width="99%"><tr><td class="BBquote"><strong><em>Originally posted by pompomJuice</strong></em><br /><br />Aah, never mind. <div>&nbsp;</div><div>I found the problem.</div><div>&nbsp;</div><div>If you create the FK relationship Entity1.PK &lt;------- Entity2.PK/FK then you must drag the mouse from entity1.PK to entity2.PK/FK when you are in SSMS's Database Diagram Mode. Basically my foreign key was the wrong way around and I failed to spot it.</div><div>&nbsp;</div><div>Usually when you make FKs you drag&nbsp;the FK&nbsp;from the Foreign Key Base Table to the Primary/Unique Key Base table's PK. But when your FK is a PK, you have to&nbsp;drag it the other way around for some reason. Bizarre.</div><p></td></tr></table></p><p><br></p><p>Thanks a lot! It was helpful for me, my problem solved. Thanks!</p>]]>
   </description>
   <pubDate>Fri, 31 Aug 2012 08:05:55 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2365&amp;PID=14295#14295</guid>
  </item> 
  <item>
   <title>Add/Insert &amp; one to one mappings (SL) : Aah, never mind.   I found the...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2365&amp;PID=9362#9362</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=877" rel="nofollow">pompomJuice</a><br /><strong>Subject:</strong> 2365<br /><strong>Posted:</strong> 10-Dec-2010 at 5:53am<br /><br />Aah, never mind. <DIV>&nbsp;</DIV><DIV>I found the problem.</DIV><DIV>&nbsp;</DIV><DIV>If you create the FK relationship Entity1.PK &lt;------- Entity2.PK/FK then you must drag the mouse from entity1.PK to entity2.PK/FK when you are in SSMS's Database Diagram Mode. Basically my foreign key was the wrong way around and I failed to spot it.</DIV><DIV>&nbsp;</DIV><DIV>Usually when you make FKs you drag&nbsp;the FK&nbsp;from the Foreign Key Base Table to the Primary/Unique Key Base table's PK. But when your FK is a PK, you have to&nbsp;drag it the other way around for some reason. Bizarre.</DIV><span style="font-size:10px"><br /><br />Edited by pompomJuice - 10-Dec-2010 at 5:57am</span>]]>
   </description>
   <pubDate>Fri, 10 Dec 2010 05:53:48 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2365&amp;PID=9362#9362</guid>
  </item> 
  <item>
   <title>Add/Insert &amp; one to one mappings (SL) : Hi.  I am trying to achieve...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2365&amp;PID=9358#9358</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=877" rel="nofollow">pompomJuice</a><br /><strong>Subject:</strong> 2365<br /><strong>Posted:</strong> 10-Dec-2010 at 1:54am<br /><br /><P>Hi.</P><DIV></DIV><DIV></DIV>I am trying to achieve a one to one mapping in my data. Firstly I set up this relationship in the database by setting one table's primary key as a foreign key into another table. <DIV>&nbsp;</DIV><DIV>Entity1.PK&nbsp; &lt;-------- Entity2.PK/FK</DIV><DIV>&nbsp;</DIV><DIV>Ideablade imports&nbsp;the model&nbsp;and everything seems to work until you try to do an&nbsp;insert Entity1/Entity2 pair in one transaction. An exception is thrown: <EM>A dependent property in a ReferentialConstraint is mapped to a store-generated column. Column:Entity1.PK"</EM></DIV><DIV>&nbsp;</DIV><DIV>A Entity1/Entity2 pair insert within one transaction works fine if you relate them in a one to many fashion though:</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Entity2.PK</DIV><DIV>Entity1.PK &lt;--------- Entity2.FK</DIV><DIV>&nbsp;</DIV><DIV>... where I presume EntityManger or EF 4.0 first insterts Entity1, extracts its generated PK and use that when inserting Entity2. I'm guessing.</DIV><DIV>&nbsp;</DIV><DIV>I am assuming this does not work with one to one relationships? Do I have to manually commit entity1, extract its PK so that I can use it to insert Entity2. This makes reject changes more compicated etc etc. What do I do here?</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Fri, 10 Dec 2010 01:54:00 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2365&amp;PID=9358#9358</guid>
  </item> 
 </channel>
</rss>