计算gridview整行数据和
表格是:语文 数学 英语 总和80 80 90
总和怎么求?
或者在数据库中如何将sum求得的数据插入另一个表格中 --------------------编程问答-------------------- foreach(GridViewRow gr in gridview1.Rows)
{
sum+=Convert.ToInt32(gr.Cell[0].Text)+...;
} --------------------编程问答--------------------
啊哈 --------------------编程问答-------------------- sql里算出来不好么? --------------------编程问答-------------------- 很简单的一个sql语句就能弄好呀
--------------------编程问答-------------------- 在数据库中分数要一条条写吗?
declare @table table(
chinese int,math int,english int
)
insert into @table(chinese,math,english)
select 78,80,55 union all
select 80,77,68 union all
select 90,80,54
select chinese,math,english,(chinese+math+english) as total from @table
然后再相加?
我想做的是原有的每行的分数都通过代码自动进行相加呀
补充:.NET技术 , C#