Dim strs As List(of String) = CurrentTable.DataTable.GetValues("样品编号") For Each str As String In strs Dim drs As List(of DataRow) = CurrentTable.DataTable.Select("样品编号='" & str & "'","测量值 desc") Dim 平均值 As Double = ( drs(1)("测量值") + drs(2)("测量值") + drs(3)("测量值") ) /3 Dim dd As List(of DataRow) = CurrentTable.DataTable.Select("样品编号='" & str & "'","_sortkey") dd(2)("平均值") = 平均值 Next
|