title: Calling stored procedure using NHibernate
body: <p>I can't get this stored procedure call to work. I keep getting a "Additional information: Parameter UserName does not exist as a named parameter in [LockUser]" message</p>
  
  <pre><code>using (var session = sm.OpenSession())         
  {
      var query = session.CreateSQLQuery("LockUser")
      .SetString("UserName", User.UserName.ToString());                  
  } 
  </code></pre>
  
  <p>mapping</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;                                                        &lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
  namespace="Models.Mappings" assembly="Intranet"&gt;
  &lt;sql-query name="LockUser"&gt;
      &lt;property name="UserName"/&gt;
      exec LockUser :UserName
  &lt;/sql-query&gt;
  </code></pre>
  
  <p></p>
  
  <p>can anyone point me in the right direction?</p>