可不可以将多个计算结果放到GridView中,进行显示~~~    select count(type1)as QTY7 from record where type1='87'and dependtype='2'
    select count(type1)as QTY8 from record where type1='88'and dependtype='2'
   
    具体怎么实现`~~~~~

解决方案 »

  1.   

    先把结果组成一个结果集,再绑定datagrid
      

  2.   

    定义新行,把查到的数据加到里面,gridview再添加该新行
      

  3.   

    如果都是这样的话,你把结果一个个放到datatable里面就可以了,之后再绑定。datatable根据列与行进行操作,这个应该是没有问题的,有问题请参考MSDN
      

  4.   

    用dataset或者hashtable把结果放里面。
      

  5.   

    gridview添加新行就可以了,把你要显示的数据都取出来,组合在gridview里头,然后bind
      

  6.   

    你做查询的时候union成一个结果行否?select count(type1)as QTY7 from record where type1='87'and dependtype='2' 
    union
    select count(type1)as QTY8 from record where type1='88'and dependtype='2' 
      

  7.   

    select count(type1)as QTY7 from record where (type1='87' and dependtype='2') or (type1='88'and dependtype='2')