How to get null value from database for checkbox in gridview
I have a checkbox in gridview.
<asp:CheckBox ID="chkStatus" runat="server" Checked='<%#GetStatus(Eval("VaccinationCompletedStatus")) %>'/> The GetStatus function 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 comes as null from the database, then one error appears, since System.DBNull cannot be passed to the object. If null comes from the database, I want to set the false flag.
+4
3 answers