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

  • Thread starter Thread starter Rob G
  • Start date Start date
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.
 
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.
 
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.
 
Back
Top