title: Nhibernate float issue with sql float in c#
body: <p>I have a nullable float column in a sql table which is mapped in Nhibernate. The property for this table class is defined:</p>
  
  <pre><code>public virtual float? floatColumn { get; set; }
  </code></pre>
  
  <p>I have another class which has</p>
  
  <pre><code>public float? anotherFloatPrprty { get; set; }
  </code></pre>
  
  <p>I get this error</p>
  
  <blockquote>
    <p>The type System.Double can not be assigned to a property of type System.Nullable`1[System.Single] setter of MyProject</p>
  </blockquote>
  
  <p>with the following session query</p>
  
  <pre><code>var j = session.CreateSQLQuery("SELECT floatColumn As anotherFloatPrprty from myTable")
  </code></pre>
  
  <p>So I changed the table to have that column as not null, But I still get the following error.</p>
  
  <blockquote>
    <p>{"Object of type 'System.Double' cannot be converted to type 'System.Single'."}</p>
  </blockquote>
  
  <p>Obviously when I don't have any value in floatColumn, I don't get any exceptions, but as soon as some values are inserted to the table (ranging from 0.01 to 1), I get these exceptions.</p>
  
  <p>How do I map nullable float correctly in Nhibernate</p>