参考:
Select Case e.DataCol.Name
Case "入库编号","产品名称","产品批号"
Dim cnt As Integer = e.DataTable.Compute("Count(产品批号)","入库编号='" & e.DataRow("入库编号") & "' And 产品名称='" & e.DataRow("产品名称") & "' and 产品批号='" & e.DataRow("产品批号") & "' and [_Identify] <= " & e.DataRow("_Identify"))
e.DataRow("检验提示") = "第" & cnt & "次"
End Select