Dim drs As List(Of DataRow) drs= DataTables("表C").Select("产品 ='" & Tables("表B").Current("产品") & "'") For Each dr As DataRow In drs Dim cnt As Integer = DataTables("表C").Compute("Count(产品)","产品 ='" & dr("产品") & "'") MessageBox.Show("找到共" & cnt & "条") Next