Member_2_1242703
asked on
Checking a checkbox based on SQL DataReader boolean value in ASP.NET(VB)
I'm using the following to populate text fields from a data reader:
I have some checkboxes that I would like to do the same thing from boolean values. How would I check the box for true, keep unchecked if false?
If Not CType(Session.Item("reader"), Data.SqlClient.SqlDataReader)("MyField") Is DBNull.Value Then
tbMyTB.Text = CType(Session.Item("reader"), Data.SqlClient.SqlDataReader)("MyField").ToString
Else
tbMyTB.Text = ""
End If
I have some checkboxes that I would like to do the same thing from boolean values. How would I check the box for true, keep unchecked if false?
checkbox1.checked = tablevalue.truefalse
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.