http://www.microsoft.com/zh-tw/download/confirmation.aspx?id=6442
下載Microsoft 報表檢視器 2010 可轉散發套件
下載Microsoft 報表檢視器 2010 可轉散發套件
dim count as integer
Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
'個人習慣將要加的欄位轉成template
If e.Row.RowType = DataControlRowType.DataRow Then
dim countval as label = e.Row.FindControl("加總欄位id")
count += CType(countval.Text, Integer)
elseIf e.Row.RowType = DataControlRowType.Footer Then
e.Row.Cells(0).Text = "總分:"
e.Row.Cells(1).Text = count
end if
end sub
DataTable dt = new DataTable();
string s_sum = dt .Compute("SUM(欄位名稱)", "").ToString();