hi guys, i have a checkbox in gridview.
<asp:CheckBox ID="chkStatus"
runat="server"
Checked='<%#GetStatus(Eval("VaccinationCompletedStatus"))
%>'/>
The function GetStatus is as follows
Public Function GetStatus(ByVal objStatus As Object) As Boolean
If objStatus = True Then
Return True
ElseIf objStatus = False Then
Return False
Else
Return False
End If
End Function
But if Status is coming as null from database then one error is coming as System.DBNull cannot be cast to object.If null is coming from database i want to get checkbox checked false.