title: NHibernate how to set a string type query-param for a named query
body: <p>I am calling a stored procedure through NHibernate. Everything is working except that it does not return any values when I try to set the stored procedure input parameter through code.<br/></p>
  
  <p>So for a stored procedure whose signature is like<br/></p>
  
  <pre>
  dbo.sp_MySp @search_option char(10),  ......<br/>
  </pre>
  
  <h2>This works</h2>
  
  <p>mapping<br/></p>
  
  <pre><code>    &lt;sql-query name="sp_MySp"&gt;
        exec dbo.sp_MySp @search_option='ab', ...
      &lt;/sql-query&gt;
  </code></pre>
  
  <p>code</p>
  
  <pre>
  var query = Session.GetNamedQuery("sp_MySp");<br/>
  var results = query.List();<br/>
  </pre>
  
  <h2>This does not work</h2>
  
  <p>Mapping<br/></p>
  
  <pre><code>&lt;sql-query name="sp_MySp"&gt;
          &lt;query-param name="search_option" type="String"/&gt;
           exec dbo.sp_MySp @search_option=:search_option, ---
  &lt;/sql-query&gt;
  </code></pre>
  
  <p>code<br/></p>
  
  <pre>
  var query = Session.GetNamedQuery("sp_MySp");<br/>
  query.SetParameter("search_option", "ab");<br/>
  var results = query.List();<br/>
  </pre>
  
  <p>Can someone point out what I am missing here....</p>