-->
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.  [ 1 post ] 
Author Message
 Post subject: Please Help me about Native SQL.
PostPosted: Mon May 05, 2008 12:26 am 
Newbie

Joined: Thu Mar 27, 2008 10:35 pm
Posts: 4
Location: VN
After i execute these code :

string sql = "select productname,d.Unitprice,quantity,discount,Categoryname,companyname from orderdetails d,products p, suppliers s,categories c " +
"where p.supplierid=s.supplierid and p.categoryid=c.categoryid and d.productid=p.productid and orderid='10611'";


ISQLQuery query = b.Session.CreateSQLQuery(sql)
.AddScalar("ProductName", NHibernateUtil.String)
.AddScalar("UnitPrice", NHibernateUtil.Double)
.AddScalar("Quantity", NHibernateUtil.Int16)
.AddScalar("Discount", NHibernateUtil.Int16)
.AddScalar("CategoryName", NHibernateUtil.String)
.AddScalar("CompanyName", NHibernateUtil.String);
IList list = query.List();


return list;

and I have a datagridview. I set DataSource of Datagridview like this;

dgv.DataSource=list;

it give me a lot of column name: Length,SyncRoot,Rank,IsReadOnly....
I just wanna show the result of the sql query on Datagirdview.

Can somebody explain me and tell me what to do this?
Thanks alot!

_________________
JC


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

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.