ISession s = Dal.Session;
string queryString = @"select t.SellDate as SellDate, t.DocumentNumber as DocNo, t.PriceGross as Gross,
t.PaymentDate as PaymentDate, ts.SettlementValue as SettlementValue, ds.{Path} + '\' + ds.Name as FilePath
from TransactionSettlement ts, Transaction t, DocScanned ds
where ts.TransactionId = t.Id and t.DocID = ds.DocID and ts.PaymentId = :paymentID";
query.SetInt32("paymentID", paymentID);
IQuery query = s.CreateQuery(queryString);
IList resultList = query.List();
如何将nhibernate查询结果绑定到asp.net datagrid?Nhibernate - 查询结果到asp.net datagrid
:-)我想通过给列别名绑定到数据网格: ...的 ... –
Mark
2010-05-18 12:31:57
@Mark:好的?列别名(成为属性别名)将仍然工作,如果你以这种方式绑定数据(或者至少他们应该)。 – R0MANARMY 2010-05-18 13:06:11
我得到这个错误,如果我直接数据绑定resultList: “的DataBinding:‘System.Object的[]’不包含名为‘文件路径’属性......” – Mark 2010-05-19 11:49:00