当前位置: 代码迷 >> ASP.NET >> girdview绑定时分的疑问
  详细解决方案

girdview绑定时分的疑问

热度:6640   发布时间:2013-02-25 00:00:00.0
girdview绑定时候的疑问
SQL code
 
select c.cod_mitem,b.rot_ord,b.Plan_wkhr_m,(sum(a.plan_wkhr_n) + sum(a.plan_wkhr_o))from web_wlms_o4sequence_user a
      left join web_wlms_o3sequence b on a.rot_ord_id = b.id
      left join web_wlms_o2order c on b.num_ord_id = c.id
      group by c.cod_mitem,b.rot_ord,b.Plan_wkhr_m order by rot_ord

其他绑定都没问题,就是,(sum(a.plan_wkhr_n) + sum(a.plan_wkhr_o))这个在 gridview绑定DataField的时候应该怎么写啊

------解决方案--------------------------------------------------------
,(sum(a.plan_wkhr_n) + sum(a.plan_wkhr_o)) as sum_plan_wkhr 起个别名
然后绑定 sum_plan_wkhr