Hi Akshay,

try this

>
>  public class ProcResult
>     {
>         public virtual int ID { get; set; }
>         public virtual string Name { get; set; }
>         public virtual string Price { get; set; }
>         public virtual int AddressID { get; set; }      
>         public virtual string Address { get; set; }
>         public virtual string Pincode { get; set; }
>     }
>
>
>
> The hbm file for the proc is :
>
> <?xml version="1.0" encoding="utf-8" ?>
> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="TestHBN">  
>   <sql-query name="testProc">
>     <return alias="PR" class="TestHBN.Models.ProcResult, TestHBN">
>
      <return-property name="ID" column="ID"/>
>       <return-property name="Name" column="Name" />
>       <return-property name="Price" column="Price" />
>       <return-property name="AddressID" column="AddressID" />
>       <return-property  name="address" column="address" />
>       <return-property  name="pincode" column="pincode" />
>     </return>
>     Call testProc;
>   </sql-query>
> </hibernate-mapping>
>
> The ProcResultMap class is 
>
> public ProcResultMap() : classmap<ProcResult>
> {           
>
               Table("testProc");

>             Id(x => x.ID);
>             Map(x => x.Name);
>             Map(x => x.Price);
>             Map(x => x.AddressID);            
>             Map(x => x.Address);
>             Map(x => x.Pincode);
> }
>
>
>
> using (var session = NHibernateHelper.OpenSession())
>             {
>                 using (var transaction = session.BeginTransaction())
>                 {                   
>                     var list = session.GetNamedQuery("testProc").List();   
>                   
>                     ViewBag.List1 = list;
>                 }
>             }
>
>
i modified your code i didnt test but i think this will work pls check and 
make sure that column names in the tables and the entity properties are 
same or not. if not same map it in map class ok.
 

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fluent-nhibernate+unsubscr...@googlegroups.com.
To post to this group, send email to fluent-nhibernate@googlegroups.com.
Visit this group at http://groups.google.com/group/fluent-nhibernate.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to