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)))
 
Back
Top