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

matlab - How to equate a structure array to structure array -

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