DropDownList help

B

Brett Baisley

Hello

I am trying to populate an asp dropdownlist by doing the following:

ddlArtist.items.add(myReader.GetString(0), myReader.GetInt32(1))

However, this doesn't work. I am trying to add an item with a name, value
pair, but I can't seem to figure out how. Does anyone know how to do this?

Thanks
 
S

Shailesh Jannu

Try This

ddlArtist.items.add(new ListItem(myReader.GetString(0),
myReader.GetInt32(1)))
 

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

Similar Threads

Help 1
Please help! 1
Help with an algorythm 5
Looking For Help 2
Help Changing Code for a Wordpress Website Menu Color 0
Arduino Code Please Help 0
dropdownlist problem 6
I need help with a Gemini prompt 1

Members online

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top