【发布时间】:2017-01-04 10:06:54
【问题描述】:
我一直在寻找
我的桌子是:
Passenger | Destination | Status
23 | Mars | PWD
我可以在第 3 列找到 PWD 的值,但我无法在第 1 列乘以它,因为第 3 列的值为 PWD。p>
这是我查找 PWD 值的代码:
For a As Integer = 0 To DataGridView1.Rows.Count - 1
If (DataGridView1.Rows(a).Cells(2).Value IsNot DBNull.Value Or Trim(DataGridView1.Rows(a).Cells(2).Value <> Nothing) AndAlso DataGridView1.Rows(a).Cells(2).Value = "PWD") Then
PWD = PWD + 1
End If
Next
Dim pwdcount = (From row As DataGridViewRow In DataGridView1.Rows _
Where row.Cells("Status").Value = "PWD" And row.Cells("Status").Value IsNot DBNull.Value _
Select row.Cells("Status").Value).Count()
label1.text = "The number of PWD is : " & pwdcount
【问题讨论】: