title: Generic ADO.Exception NHibernate
body: <p>I have this table: </p>
  
  <p>TABLE "Set": [PK:IdSet (int), IdProject (int),IdSetState(int),IdPriority(int),NumSet(int),Unit(nchar),NumDisc(int)]</p>
  
  <p>So, I make the Test NUnit for insert a value in this table. This is my Test method:</p>
  
  <pre><code>[Test]
  public void Can_add_Set()
  {
        var set = new Set { IdProject = 2, IdSetState = 2, NumDisc = 1, IdPriority = 3, NumSet = 100};
        setRepository.AddSet(set);
   }
  </code></pre>
  
  <p>And this is my insert method:</p>
  
  <pre><code>public void AddSet(Set set) 
      {
          using (ISession session = NHibernateSessionBuilder.OpenSession())
          using (ITransaction transaction = session.BeginTransaction())
          {
              session.Save(set);
              transaction.Commit();
          }
      }
  </code></pre>
  
  <p>This is the Set.hbm.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                     assembly="AdminProject"
                     namespace="AdminProject.Business.Entity"&gt;
  
    &lt;class name="Set"&gt;
      &lt;id name="IdSet"&gt;
        &lt;generator class="identity"/&gt;
      &lt;/id&gt;
      &lt;property name="IdProject" /&gt;
      &lt;property name="IdSetState" /&gt;
      &lt;property name="IdPriority" /&gt;
      &lt;property name="Unit" /&gt;
      &lt;property name="NumDisc" /&gt;
      &lt;property name="NumSet" /&gt;
    &lt;/class&gt;
  
  &lt;/hibernate-mapping&gt; 
  </code></pre>
  
  <p>When session.save(set); that show this error:</p>
  
  <p>Generic ADO.Exception</p>
  
  <p>"could not load an entity: [AdminProject.Business.Entity.Set#5][SQL: SELECT set0_.IdSet as IdSet2_0_, set0_.IdProject as IdProject2_0_, set0_.IdSetState as IdSetState2_0_, set0_.IdPriority as IdPriority2_0_, set0_.Unit as Unit2_0_, set0_.NumDisc as NumDisc2_0_, set0_.NumSet as NumSet2_0_ FROM Set set0_ WHERE set0_.IdSet=?]"</p>