title: How to get a null value from database to a checkbox in gridview
body: <p>i have a checkbox in gridview.</p>
  
  <pre><code> &lt;asp:CheckBox  ID="chkStatus"
  runat="server"
   Checked='&lt;%#GetStatus(Eval("VaccinationCompletedStatus"))
   %&gt;'/&gt;
  </code></pre>
  
  <p>The function GetStatus is as follows</p>
  
  <pre><code>  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
  </code></pre>
  
  <p>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.</p>