代码不可能报错啊,报错就请上传具体里例子
Dim dr As DataRow = e.DataRow
Dim dt As DataTable =DataTables("A表")
Dim zb1 As Integer
If e.DataCol.Name = "指标" And dr.IsNull("指标") = False Then zb1 = dt.Compute("Count(名称)", dr("指标") & " < 1") dr("C列") = zb1End If