参考代码
If e.DataCol.name.startswith("市内_") Then Dim i As Integer = 0 For Each dc As DataCol In e.DataTable.datacols If dc.name.StartsWith("市内_") AndAlso e.DataRow.isnull(dc.name) = False Then i += 1 End If Next e.DataRow("市内家数") = iEnd If