-->
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: Column Aliases
PostPosted: Thu Nov 10, 2005 2:32 am 
Newbie

Joined: Thu Nov 10, 2005 2:15 am
Posts: 1
ISession session = null;

session = Program.NHFactory.OpenSession();

IList emp = session.CreateQuery("select e.Emp_id, e.Fname, e.Minit,
e.Lname from Employee e").List();

//Employee is a Persistent Class (employee is a SQL Server 2000 table)

Using the above code, I am specifying the datasource of a datagridview as "emp". I am NOT able to get the values for any column/rows by specifying the aliases (Emp_id, Fname, Minit, Lname) as datapropertyname. I am not getting any error but the datagridview is NOT at all populating any values. But "emp" is getting populated correctly.

Any help to solve this problem would be greatly appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 10, 2005 11:19 am 
Contributor
Contributor

Joined: Thu May 12, 2005 8:45 am
Posts: 226
You are doing a "scalar query", which will return an object[], not an IList of the type you are expecting. If you want to use scalar queries, please check this thread and see if that will solve your problem.


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.