DropDownList help

  • Thread starter Thread starter Brett Baisley
  • Start date Start date
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
 
Try This

ddlArtist.items.add(new ListItem(myReader.GetString(0),
myReader.GetInt32(1)))
 
Then how do I get it out of there? selected.value or something like that?
 

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

Back
Top