fill dropdown list thru dataset

K

K R Lal

Hi,

Any idea how to fill a dropdownlist thru dataset

I done like this
ddLst1.DataSource = myDataSet
ddLst1.DataMember = myDataSet.Tables(0).Columns(1).Caption

ddLst1.DataValueField = myDataSet.Tables(0).Columns(0).Caption

but it is not working ; my dropdown list showing blanck

please help me
--
Regards

K R Lal

--
Regards

K R Lal
Luxor

Disclaimer
-------------------------------------------------------
This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the system manager.
Please note that any views or opinions presented in this email are solely
those of the author and do not necessarily represent those of the company.
Finally, the recipient should check this email and any attachments for the
presence of viruses. The company accepts no liability for any damage caused
by any virus transmitted by this email.
 
P

Peter van der Goes

K R Lal said:
Hi,

Any idea how to fill a dropdownlist thru dataset

I done like this
ddLst1.DataSource = myDataSet
ddLst1.DataMember = myDataSet.Tables(0).Columns(1).Caption

ddLst1.DataValueField = myDataSet.Tables(0).Columns(0).Caption

but it is not working ; my dropdown list showing blanck

please help me
Try this instead of using the Columns collection Caption property.

DropDownList1.DataTextField = DsAuthors1.Tables(0).Columns(1).ToString()
 

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

Top