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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Other Discussions
  3. IT & Infrastructure
  4. dropdown list bound problem in asp.net 2005 when i clike the dropdown which has only one value

dropdown list bound problem in asp.net 2005 when i clike the dropdown which has only one value

Scheduled Pinned Locked Moved IT & Infrastructure
helpcsharpswiftasp-netdatabase
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.
  • P Offline
    P Offline
    priyamsc
    wrote on last edited by
    #1

    Hi, I have 3 dropdownlist in my web form. in first dropdown has the values from database when page gets loaded. and next when i click the first dropdown list then the second one should be filled based on that first dropdownlist. and for 3rd dropdown also same as first.... The problem is if the second dropdownlist has only one value then let me try to fill in the 3rd dropdownlist... it wont fill becaue i have given the coding in dd2_selectedindexchanged()event.. so its not coming.. i need the values even if the dropdownlist has one value. pls help me this is the coding ================== protected void dd1_SelectedIndexChanged(object sender, EventArgs e) { string a = "select distinct a.descriptions,a.sid from swift a,pc_link b where swiftid='loc'and a.sid=b.locationid and blockid="+dd1.SelectedValue; adp = new SqlDataAdapter(a, con); ds = new DataSet(); adp.Fill(ds, "swift"); dd2.DataSource = ds.Tables["swift"].DefaultView; dd2.DataTextField = "descriptions"; dd2.DataValueField = "sid"; dd2.DataBind(); } thank you,

    k.priya

    P 1 Reply Last reply
    0
    • P priyamsc

      Hi, I have 3 dropdownlist in my web form. in first dropdown has the values from database when page gets loaded. and next when i click the first dropdown list then the second one should be filled based on that first dropdownlist. and for 3rd dropdown also same as first.... The problem is if the second dropdownlist has only one value then let me try to fill in the 3rd dropdownlist... it wont fill becaue i have given the coding in dd2_selectedindexchanged()event.. so its not coming.. i need the values even if the dropdownlist has one value. pls help me this is the coding ================== protected void dd1_SelectedIndexChanged(object sender, EventArgs e) { string a = "select distinct a.descriptions,a.sid from swift a,pc_link b where swiftid='loc'and a.sid=b.locationid and blockid="+dd1.SelectedValue; adp = new SqlDataAdapter(a, con); ds = new DataSet(); adp.Fill(ds, "swift"); dd2.DataSource = ds.Tables["swift"].DefaultView; dd2.DataTextField = "descriptions"; dd2.DataValueField = "sid"; dd2.DataBind(); } thank you,

      k.priya

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      Two things. First this should have been with the one below, and second you should have posted them in the ASP.NET forum - this is not the right folder for them.

      Deja View - the feeling that you've seen this post before.

      My blog | My articles

      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