Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Populating Dropdown list

Populating Dropdown list

Scheduled Pinned Locked Moved Visual Basic
database
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    macca24
    wrote on last edited by
    #1

    I have a dropdown list called ddlstat and I want to populate it with values from a database table called status. The value I want to get from Status table is Status name. here is the code for ddlstat: Private Sub ddlStat_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ddlStat.SelectedIndexChanged End Sub Does anyone have the code to use to populate a ddl. Thanks macca

    S 1 Reply Last reply
    0
    • M macca24

      I have a dropdown list called ddlstat and I want to populate it with values from a database table called status. The value I want to get from Status table is Status name. here is the code for ddlstat: Private Sub ddlStat_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ddlStat.SelectedIndexChanged End Sub Does anyone have the code to use to populate a ddl. Thanks macca

      S Offline
      S Offline
      StealthMaker
      wrote on last edited by
      #2

      im not sure if this is what your looking for but... Private Sub ddlStat_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ddlStat.SelectedIndexChanged ddlstat.items.clear dim i as integer For i = 0 To (DataSet11.Tables("status").Rows.Count - 1) ddlstat.items.add(DataSet11.Tables("employee").Rows(i).Item("Status_Name")) 'status_name = column name in table next end sub

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups