-->
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.  [ 3 posts ] 
Author Message
 Post subject: about HQL Search and Bind
PostPosted: Fri Oct 21, 2005 4:36 am 
Code:
hql= "SELECT a.Id, a.Name FROM user a" ;


I want to bind a DropDownList.
Code:
    <asp:DropDownList ID="ddlTargetActorType" runat="server" DataTextField="Name" DataValueField="Id">


but NHibernate IQuery return IList, I can't Bind. howe'er I want not used.
Code:
hql="SELECT a FROM user a"
]


then what?


Top
  
 
 Post subject:
PostPosted: Fri Oct 21, 2005 11:25 am 
Beginner
Beginner

Joined: Mon Oct 03, 2005 4:59 am
Posts: 26
Location: Cambridge, UK
Not entirely sure I understand your question, but are you perhaps looking for something like this?
Code:
<asp:DropDownList ID="ddlTargetActorType" runat="server"
    DataTextField='<%# DataBinder.Eval( Container, "DataItem.Id" ) %>'
    DataValueField='<%# DataBinder.Eval( Container, "DataItem.Name" ) %>'  />


You should be able to DataBind() that to teh results of IQuery.List() for your hql query, if I'm not mistaken.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 21, 2005 8:39 pm 
Yes, the resulting IList of an Hql query can be bound to an asp drop down list. I do it almost every day.


Top
  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.