Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Help binding a DataTable to a DropDown List

Reply
Thread Tools

Help binding a DataTable to a DropDown List

 
 
keithb
Guest
Posts: n/a
 
      04-04-2006
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


 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      04-04-2006
DropDownList1.DataSource=dt;
DropDownList1.DataValueField="EnvID";
DropDownList1.DataTextField="ShortName";

Eliyahu

"keithb" <> wrote in message
news:e3U%...
> 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
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sort a datatable and create a new datatable Fredrik Rodin ASP .Net 3 09-28-2007 07:28 AM
How can I add a row from a typed datatable to another instance of that typed datatable? Ersin Gençtürk ASP .Net 1 10-06-2004 01:11 PM
Create a Datatable from a SQL datatable column shema? jg ASP .Net 1 08-17-2004 09:43 PM
Casting DataTable to class inherit from DataTable =?Utf-8?B?Qmx1ZWZsb3dlcg==?= ASP .Net 0 04-02-2004 05:41 AM
Adding DataTable Rows To another DataTable J. Babe ASP .Net 1 08-15-2003 05:04 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57