Select Case e.DataCol.name Case "第一列","第二列","第三列","第四列" Dim d1 As Double = val(e.DataRow("第一列")) Dim d2 As Double = val(e.DataRow("第二列")) Dim d3 As Double = val(e.DataRow("第三列")) Dim d4 As Double = val(e.DataRow("第四列")) Dim d5 As Double If e.DataRow.IsNull("第一列") Then e.DataRow("第一列") = Nothing d1 = 1 End If If e.DataRow.IsNull("第二列") Then e.DataRow("第二列") = Nothing d2 = 1 End If If e.DataRow.IsNull("第三列") Then e.DataRow("第三列") = Nothing d3 = 1 End If If e.DataRow.IsNull("第四列") Then e.DataRow("第四列") = Nothing d4 = 1 End If d5=d1*d2*d3*d4 e.DataRow("第五列")=d5 End Select
|