Help binding a DataTable to a DropDown List

K

keithb

Can someone tell me which properties of a DataTable are used for binding to
a DropDown list?
I have a DataTable named dt
I think that I need to bind the "EnvID" column to
DropDownList1.DataValueField
and the "ShortName" column to DropDownList1.DataTextField

Thanks,

Keith
 
E

Eliyahu Goldin

DropDownList1.DataSource=dt;
DropDownList1.DataValueField="EnvID";
DropDownList1.DataTextField="ShortName";

Eliyahu
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top