How do I bind values to a drop-down User Control?

R

Rob G

Hi,

I've made a User Control with a drop-down list box (OK, copied it out of a
book). It binds to a SQL statement which links to my database. All the code
is in the ascx.vb file.

Now I want to make a User Control drop-down list box that only has two
values, "Yes" and "No". That way I can use it in multiple places (that is
the right idea?). I just can't figure out how to do this using VS2003 and
VB. I am originally an Access user, so I think my head may be stuck in that
mode.

Can this be done, or should I make a table containing two values and link to
that? Although that seems silly to me.

Thanks for the help.
 
E

Elliot M. Rodriguez, MCSD

You could create a UC for this, but IMO this is overkill for a simple yes/no
radiobutton.

You could consolidate it to a single checkbox (checked = yes, unchecked =
no)... and tie this to a BIT field in SQL Server/Access.
 
R

Rob G

Thanks for the info. For some reason, I never thought of using the checkbox.
It makes much more sense.

I guess my head has been in the books for too long.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,809
Latest member
moe77

Latest Threads

Top