I am going to count the checked and unchecked check box in my attendance but that come out in my code."Operator '=' is not defined for type 'DBNull' and type 'Boolean'.??"... pls help..your help is greatly appreciated. thanks
my code:
Next
Dim Present As Integer = 0
Dim Absent As Integer = 0
For a = 0 To Table2___lieDataGridView.RowCount - 1
For b = 0 To Table2___lieDataGridView.ColumnCount - 8
If Table2___lieDataGridView.Rows(a).Cells(b + 5).Value = True Then
Present += 1
Else
Absent += 1
End If
Next
Table2___lieDataGridView.Rows(a).Cells(10).Value = Present
Table2___lieDataGridView.Rows(a).Cells(11).Value = Absent
Present = 0
Absent = 0
Next
Nothing
orDBNull
and if it is not then you can safely cast it to aBoolean
and then make the comparison. – Alex Wiese