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

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top