VS 2003 Binding Drop Box

  • Thread starter Thread starter Frank Bishop
  • Start date Start date
F

Frank Bishop

Can anyone point me to an example on the net of how to bind a drop box
on a Web form using VS2003.net? for some reason, I can't get my drop box
or list box to bind to my dataset. I am using VB.Net.

Help appreciated.
Frank
 
ddl.DataSource = ds.Tables[0]
ddl.DataTextField = "ColumnText"
ddl.DataValueField = "ColumnValue" // usually id
ddl.DataBind()

where ddl is DropDownList or ListBox and ds is your DataSet.

Hope this helps!
Regards,
Kostadin Kostov
 
Hi Frank
Try this:
mylist.dataSource=ds
mylist.dataMember="MyTable"
mylist.dataTextFiled="MyDataCoulum" '''''''''''''' this is the most
important
mylist.dataBind()
 
Back
Top