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

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -