nhibernate的Session.Find方法返回的可能是一个对象数组的集合, 例如Find("Select customer.Id, customer.Name From Customer customer") , 它返回的是由object[2]组成的ArrayList. 不知怎么绑定到DataGrid好, 后来发现DataBinder.Eval可以用"[xxx]"的表达式去访问索引器. 所以
<%#DataBinder.Eval(Container.DataItem, "[0]")%>
<%#DataBinder.Eval(Container.DataItem, "[1]")%>
就分别可以得到Customer的Id和Name了



相关文章:

  • 2022-01-31
  • 2022-12-23
  • 2021-04-08
  • 2022-01-31
  • 2021-09-18
  • 2021-07-13
  • 2022-02-28
  • 2021-07-13
猜你喜欢
  • 2022-01-24
  • 2022-02-11
  • 2021-07-12
  • 2022-12-23
  • 2021-07-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案