-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: NHibernateUtil return type for Ilist
PostPosted: Fri May 29, 2009 2:11 am 
Newbie

Joined: Fri Mar 20, 2009 4:19 am
Posts: 11
Hi,

Below is my code, i want to return the query output in list and bind with datagrid, but i am getting error. Can anybody help me?

what would be return type for NHibernateUtil?

config = new NHibernate.Cfg.Configuration();


config.AddAssembly(typeof(CSTS.Main.CashPosting).Assembly);
factory = config.BuildSessionFactory();

session = factory.OpenSession();

IList<CSTS.Main.CashPosting> cashpostlist= session.CreateSQLQuery("SELECT * FROM CSTS_T_CASH_POSTING C INNER JOIN CSTS_M_FUNDGROUP F ON C.Acct_Cd=F.Acct_Cd WHERE F.Acct_Grp_Cd='ASPRUI'","CSTS_T_CASH_POSTING",NHibernateUtil.).List <CSTS.Main.CashPosting>();

grdAll.DataSource = cashpostlist;

grdAll.DataBind();


Top
 Profile  
 
 Post subject: Re: NHibernateUtil return type for Ilist
PostPosted: Sat May 30, 2009 5:16 am 
Expert
Expert

Joined: Thu Dec 14, 2006 5:57 am
Posts: 1185
Location: Zurich, Switzerland
And the error would be ?

IList<CSTS.Main.CashPosting> cashpostlist= session.CreateSQLQuery("SELECT * FROM CSTS_T_CASH_POSTING C INNER JOIN CSTS_M_FUNDGROUP F ON C.Acct_Cd=F.Acct_Cd WHERE F.Acct_Grp_Cd='ASPRUI'","CSTS_T_CASH_POSTING",NHibernateUtil.).List <CSTS.Main.CashPosting>();

There's something wrong in your code, but that's probably only in the post because otherwise it wouldn't even compile.

_________________
--Wolfgang


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.