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
|