Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>K. I think I found the cause of this kind of issue. I have a situation with a many to many in my EF diagram (Scholarhip table, Survey table, ScholarshipSurvey table {this is a bridge table}). Well after some serious soul searching I found this in my ScholarshipSurvey table entry in the EDMX:</p> <pre><code> &lt;EntityType Name="ScholarshipSurvey"&gt; &lt;Key&gt; &lt;PropertyRef Name="ScholarshipID" /&gt; &lt;PropertyRef Name="SurveyID" /&gt; &lt;/Key&gt; &lt;Property Name="ScholarshipID" Type="int" Nullable="false" StoreGeneratedPattern="Identity" /&gt; &lt;Property Name="SurveyID" Type="int" Nullable="false" StoreGeneratedPattern="Identity"/&gt; &lt;/EntityType&gt; </code></pre> <p>I was thinking, no way! Why did the EF make these "identities". They are not in the data model from whence the came. So, when I openned the EDMX using a XML editor (instead of the default double click), I removed the entry <strong>StoreGeneratedPattern="Identity"</strong> for both the scholarship id and survey id. Then, I tried my normal code for adding items into the collection and removing items from the collection and it WORKED!</p> <p>All I can think is that this is a bug in EF4 that shouldn't have been. The only other way to solve this is to make the bridge table an object by adding an identity of its own to the table. Gee. Hope this helps some poor soul out there.</p> <p><strong>Update</strong> (rwwilden): There is a <a href="https://connect.microsoft.com/data/feedback/details/540058" rel="nofollow noreferrer">Microsoft Connect report</a> for this issue.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload