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. Web Development
  3. ASP.NET
  4. query

query

Scheduled Pinned Locked Moved ASP.NET
helpdatabasetutorialquestion
6 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.
  • R Offline
    R Offline
    R Thomas 0
    wrote on last edited by
    #1

    hi.. is there any way i can insert a full collection into a dropdown list? what ia m trying to do is this : there are 2 dropdownlists one has the name of some tables when the user select one of the tables and then moves on to the next dropdownlist, the second dropdown list is populated with all the fields of the selected table name in the first combobox. now i have a problem with generating an ON_CLICK event for the combo box and also i would like to know how to fill the dropdownlist with all the fields?? shoudl i put all the data in collection?? can a collection be directly inserted to a dropdownlist? hope someone can pls help me... tks.. "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18

    S 1 Reply Last reply
    0
    • R R Thomas 0

      hi.. is there any way i can insert a full collection into a dropdown list? what ia m trying to do is this : there are 2 dropdownlists one has the name of some tables when the user select one of the tables and then moves on to the next dropdownlist, the second dropdown list is populated with all the fields of the selected table name in the first combobox. now i have a problem with generating an ON_CLICK event for the combo box and also i would like to know how to fill the dropdownlist with all the fields?? shoudl i put all the data in collection?? can a collection be directly inserted to a dropdownlist? hope someone can pls help me... tks.. "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18

      S Offline
      S Offline
      Sarvesvara BVKS Dasa
      wrote on last edited by
      #2

      Assuming that this is a SQl querry, and in ASP.NET web page (ASPX) You can set the datasource of your dropdownlist # 1 to the dataset that returns the list of tables and set the text, values accordingly... drpList.DataSource = dm.GetValues() drpList.DataTextField = "textField" drpList.DataValueField = "valueField" drpList.ClearSelection() drpList.DataBind() drpList.Items.Insert(0, New ListItem("Select", "")) By the way, you can add the dropdownlist # 2 on the SelectedIndexChanged, for ur first dropdownlist.. Here you have to take care that dropdownlist # 2 takes no value when the 'Select' is selected in the dropdownlist # 1. Hope it is clear.. I was born intelligent
      Education ruined me!.

      R 2 Replies Last reply
      0
      • S Sarvesvara BVKS Dasa

        Assuming that this is a SQl querry, and in ASP.NET web page (ASPX) You can set the datasource of your dropdownlist # 1 to the dataset that returns the list of tables and set the text, values accordingly... drpList.DataSource = dm.GetValues() drpList.DataTextField = "textField" drpList.DataValueField = "valueField" drpList.ClearSelection() drpList.DataBind() drpList.Items.Insert(0, New ListItem("Select", "")) By the way, you can add the dropdownlist # 2 on the SelectedIndexChanged, for ur first dropdownlist.. Here you have to take care that dropdownlist # 2 takes no value when the 'Select' is selected in the dropdownlist # 1. Hope it is clear.. I was born intelligent
        Education ruined me!.

        R Offline
        R Offline
        R Thomas 0
        wrote on last edited by
        #3

        i have some doubts... wht is dm?? is it a dataset containing the values i need? wat does the below lines do? drpList.DataTextField = "textField" drpList.DataValueField = "valueField" tks a lot... appreciate your help "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18

        S 1 Reply Last reply
        0
        • S Sarvesvara BVKS Dasa

          Assuming that this is a SQl querry, and in ASP.NET web page (ASPX) You can set the datasource of your dropdownlist # 1 to the dataset that returns the list of tables and set the text, values accordingly... drpList.DataSource = dm.GetValues() drpList.DataTextField = "textField" drpList.DataValueField = "valueField" drpList.ClearSelection() drpList.DataBind() drpList.Items.Insert(0, New ListItem("Select", "")) By the way, you can add the dropdownlist # 2 on the SelectedIndexChanged, for ur first dropdownlist.. Here you have to take care that dropdownlist # 2 takes no value when the 'Select' is selected in the dropdownlist # 1. Hope it is clear.. I was born intelligent
          Education ruined me!.

          R Offline
          R Offline
          R Thomas 0
          wrote on last edited by
          #4

          you also said: You can set the datasource of your dropdownlist # 1 to the dataset that returns the list of tables and set the text, values accordingly... how can i do this?? tks.. "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18

          S 1 Reply Last reply
          0
          • R R Thomas 0

            i have some doubts... wht is dm?? is it a dataset containing the values i need? wat does the below lines do? drpList.DataTextField = "textField" drpList.DataValueField = "valueField" tks a lot... appreciate your help "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18

            S Offline
            S Offline
            Sarvesvara BVKS Dasa
            wrote on last edited by
            #5

            I am sorry, that I didnt make enough changes in my source code for u to understand... Joseph R. Thomas wrote: wht is dm?? thats my object... hmmm.... u can just replace "dm.GetValues()" with the function that returns the DATASET - containing the information = tables list from ur db source. Joseph R. Thomas wrote: drpList.DataTextField = "textField" drpList.DataValueField = "valueField" now... u will have to replace this code as, drpList.DataTextField = "TABLENAME" drpList.DataValueField = "TABLENAME" where TABLENAME, is the 'column' name that carries the list of tables that u take in the querry. I was born intelligent
            Education ruined me!.

            1 Reply Last reply
            0
            • R R Thomas 0

              you also said: You can set the datasource of your dropdownlist # 1 to the dataset that returns the list of tables and set the text, values accordingly... how can i do this?? tks.. "Rejoice always, pray without ceasing, in everything give thanks; for this is the will of God in Christ Jesus for you."1Thess. 5:16-18

              S Offline
              S Offline
              Sarvesvara BVKS Dasa
              wrote on last edited by
              #6

              JOSEPH, I have replied this in the other message. By The Way, please go through the documentation for 'DATABIND'ing of the lists - like dropdownlist/datagrid/checkboxlist etc. You will get a better idea on 'datasource', 'text', 'value' etc. I was born intelligent
              Education ruined me!.

              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