datagird 格式如下:(说明:本学年为当前学年,累计结果为入学后至当前学年总的缴费情况)____________________________________________________________________
院系名称          本学年缴费情况                   累计缴费情况 
            应缴 减免 实缴 退费 缴费率       应缴 减免 实缴 退费 缴费率 
计算机      ... ... ...  ...  ...        ... ...  ... ...  ...
...
____________________________________________________________________请高手赐教!感激!

解决方案 »

  1.   

    SQL 里面 计算出来,绑到 datagird
      

  2.   

    1,用存储过程或带有计算的SQL语句2,用函数,可以是SQL SERVER的函数,也可以程序里的函数
      

  3.   

    如:int mycount(int id)
    {
    return int.Parse(dc.getcount("select count(*) as total from table where ......").ToString());
    }
      

  4.   

    我刚学.net
    请问你的函数放在哪调用?
    还有dc是什么?
    麻烦说得详细点,辛苦了!
      

  5.   

    SqlConnection conn = new SqlConnection("Data Source=KING;Initial Catalog=Demo;Integrated Security=True");
                SqlCommand das = new SqlCommand("select sum(Convert(int,id)) as total from Users", conn);//统计多列用ExecuteReader来做
                conn.Open();
               object kk=das.ExecuteScalar();
                DataRow rw = dsUsers.NewRow();
                rw.ItemArray = new object[] {kk,null,null};
                dsUsers.Rows.Add(rw);
                dsUsers.AcceptChanges();
      

  6.   

    你可以在DataGrid itembound 事件中取你的单员来进行计算!
      

  7.   

    其实我的想法不是行统计,也不是列统计
    只是想在"本学年缴费情况"中显示08年数据,"累计缴费情况"中统计05,06,07,08的数据
    (数据库中有个字段为'收费区间')
    最后显示到一个dataGrid中
    请问各位如何实现!谢谢
    等待中...