views:

233

answers:

1

here is code, how I am calling Stored procedure

ISession session = NHibernateHelper.GetCurrentSession();
        IQuery q = session.GetNamedQuery("ps_getProgressBarData1");
        var t = q.List();

XML mapping

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"   namespace="ReleaseDAL"  assembly="ReleaseDAL">

 <sql-query name="ps_getProgressBarData1">
    <return alias="ProgressBar" class="ProgressBar">
      <return-property name="Tot" column="Tot"/>
      <return-property name="subtot" column="subtot"/>
    </return>
    exec ps_getProgressBarData1
  </sql-query>
</hibernate-mapping>

Class mapping

public virtual Int32 Tot {get { return _Tot; } set { _Tot = value; } }
    public virtual Int32 subtot { get { return _subtot; } set { _subtot = value; }}

I am getting exception: No persister for: ReleaseDAL.ProgressBar, ReleaseDAL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null

Please tell me what is the issue here?

Thanks

+2  A: 

You could get that error you don't have the mapping file marked as embedded resource. Please check that as first thing.

Claudio Redi
yes, that's very good point, now I am getting this issue -------No persister for: ReleaseDAL.ProgressBar, ReleaseDAL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
Muhammad Akhtar
Please check this other question on the site and tell me if works for you http://stackoverflow.com/questions/57804/nhibernate-mappingexception-no-persister-for
Claudio Redi
no, this is not working for me. I have already check this. I am upvoting becoz ur first clue working for, now I am getting other issue of No persister for: ReleaseDAL.ProgressBar
Muhammad Akhtar
The class ProgressBar is on the namespace "ReleaseDAL"?
Claudio Redi
yes, that's right...
Muhammad Akhtar
Sorry, I'm running out of ideas. Maybe you can paste the ProgressBar mapping and check also if this mapping file is marked as embedded resource
Claudio Redi