title: Couldn't insert into a table using nhibernate
body: <p>I'm just learning nhibernate and trying to create the first sample.</p>
  
  <p>I created an empty service-based database and wrote mappings and some code:</p>
  
  <pre><code>namespace lab
  {
      public class Skill
      {
          public virtual int Id { get; protected set; }
          public virtual string Description { get; set; }
      }
  }
  </code></pre>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
  &lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="lab" assembly="lab"&gt;
  
    &lt;class name="Skill" table="Skill"&gt;
      &lt;id name="Id"&gt;
        &lt;generator class="native"/&gt;
      &lt;/id&gt;
      &lt;property name="Description" /&gt;
    &lt;/class&gt;
  
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
  &lt;hibernate-configuration  xmlns="urn:nhibernate-configuration-2.2"&gt;
  
     &lt;session-factory&gt;
  
        &lt;property name="connection.provider"&gt;NHibernate.Connection.DriverConnectionProvider&lt;/property&gt;
        &lt;property name="connection.driver_class"&gt;NHibernate.Driver.SqlClientDriver&lt;/property&gt;
        &lt;property name="dialect"&gt;NHibernate.Dialect.MsSql2008Dialect&lt;/property&gt;
        &lt;property name="connection.connection_string"&gt;Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\Dmitriy\Desktop\lab\lab\lab\DataBase.mdf;Integrated Security=True;User Instance=True&lt;/property&gt;
  
         &lt;mapping  file="C:\Users\Dmitriy\Desktop\lab\lab\lab\Skill.hbm.xml" /&gt;
     &lt;/session-factory&gt;
  
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <pre class="lang-csharp prettyprint-override"><code>var configuration = new Configuration();            
  configuration.Configure(@"C:\Users\Dmitriy\Desktop\lab\lab\lab\hibernate.cfg.xml");
  var session = configuration.BuildSessionFactory().OpenSession();
  var transaction = session.BeginTransaction();
  var skill = new Skill {Description = "C#"};
  session.Save(skill);
  transaction.Commit();
  </code></pre>
  
  <p>When I run this I always get the error could not insert: </p>
  
  <pre class="lang-sql prettyprint-override"><code>INSERT INTO Skill (Description) VALUES (?); 
  select SCOPE_IDENTITY()
  </code></pre>
  
  <blockquote>
    <p>Invalid object name \"Skill\".</p>
  </blockquote>
  
  <p>I didn't created tables as nhibernate should create them itself.</p>
  
  <p>Could you help me to figure out why it is not working?</p>