asp.net - How to read in a Bit field to create a checkbox -


i have field in sql database bit field.

i want read in field. if 1 checkbox true, else false.

i started off code, getting error. advice on how this?

        if (myreader["tarchive"] == 1) 

regards tea

try this:

mycheckbox.checked = convert.toboolean(myreader["tarchive"]); 

Comments

Popular posts from this blog

java - Cast from Object to List<String>: CastClassException -

How to set a border for android Imageview in Longpress? -

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -