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 Studio
  4. drop down list control

drop down list control

Scheduled Pinned Locked Moved Visual Studio
databasequestion
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.
  • L Offline
    L Offline
    lakshmi_sri
    wrote on last edited by
    #1

    is it possible in VS2003 to populate a dropdownlist control with data from a table in DB rather that manually entering values.....if yes how can we do that?

    E 1 Reply Last reply
    0
    • L lakshmi_sri

      is it possible in VS2003 to populate a dropdownlist control with data from a table in DB rather that manually entering values.....if yes how can we do that?

      E Offline
      E Offline
      ebonaba
      wrote on last edited by
      #2

      You can try something like this: //Call Stored Proc and load values into a DataSet string conn = SqlHelper.GetConnectionString(); DataSet ds = SqlHelper.ExecuteDataset(conn, "spEmployeeRecords"); lstDropDownList.DataSource = ds; lstDropDownList.DataTextField = "FullName"; lstDropDownList.DataValueField = "EmployeeID"; lstDropDownList.DataBind();

      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