after check to your configuration and be sure you have that mapping as
embedded-resource or added it explicitly to the NH's configuration, please
use the nhusers group (http://groups.google.com/group/nhusers)

Thanks.

On Wed, Oct 13, 2010 at 1:39 AM, Tola Chhoeun <[email protected]> wrote:

> Hi All,
>
> I am trying to call stor-proc using NHibernate, but I alway got exception
> "Named query not known: spGetItemDetail"; type NHibernate.MappingException
>
> Here are what I got:
> ItemDetail.hbn.xml
>
> <?xml version="1.0" encoding="utf-8" ?>
> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
>  assembly="MyApplication.Common"
>  namespace="MyApplication.Common.Domain">
>
>  <sql-query name="spGetItemDetail">
>   <return class="ItemDetail">
>    <return-property column="ItemID" name="ItemID"/>
>    <return-property column="Number" name="Number">
>   </return>
>   exec dbo.spGetItemDetail :ItemId
>  </sql-query>
>
> </hibernate-mapping>
>
>
> Class ItemDetail.cs
>
> namespace MyApplication.Common.Domain
> {
>  public class ItemDetail
>  {
>    public int ItemID {get; set;}
>    public int Number {get; set;}
>  }
> }
>
>
> Calling Stor-Proc
>
> IQuery query = _session.GetNamedQuery("spGetItemDetail");      //Here is
> where I got the exception
> query.SetInt32("ItemId", 13);
> return query.List<ItemDetail>();
>
>
>
> I am so frustrated to get it working, please help.
>
> .Tola.
>



-- 
Fabio Maulo

Reply via email to