Link to home
Start Free TrialLog in
Avatar of gianitoo
gianitoo

asked on

Conversion from type 'DBNull' to type 'Boolean' is not valid.

how do u handle it in this case
Dim cholo As Boolean = CType(DataBinder.Eval(e.Row.DataItem, "morning"), Boolean)


_________this is the code if needed____________
   If e.Row.RowType = DataControlRowType.DataRow Then
            Dim lnkFile As HyperLink = CType(e.Row.FindControl("lnkFile"), HyperLink)
            Dim image1 As Image = CType(e.Row.FindControl("image1"), Image)
            Dim cholo As Boolean = CType(DataBinder.Eval(e.Row.DataItem, "morning"), Boolean)
            If cholo = True Then
                image1.visible = True
            Else
                lnkFile.Visible = True
               
            End If
        End If
ASKER CERTIFIED SOLUTION
Avatar of Raju Srivatsavaye
Raju Srivatsavaye
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial