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. Web Development
  3. ASP.NET
  4. How display data from DB by selecting from DropdownList

How display data from DB by selecting from DropdownList

Scheduled Pinned Locked Moved ASP.NET
databasehelpcsharpasp-net
5 Posts 4 Posters 1 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
    Praveen 123
    wrote on last edited by
    #1

    Sir, I am developing an application in ASP.NET.It's using a MS-Access database and I am listing ten Emp_IDs from the table Employee to DropdownList.I want to select particular Emp_Name from Employee table on click on DropdownList. Pleas help me to solve this problem.

    Praveen.K System Engineer Graviton Technologies Pvt.Ltd

    V S N 3 Replies Last reply
    0
    • P Praveen 123

      Sir, I am developing an application in ASP.NET.It's using a MS-Access database and I am listing ten Emp_IDs from the table Employee to DropdownList.I want to select particular Emp_Name from Employee table on click on DropdownList. Pleas help me to solve this problem.

      Praveen.K System Engineer Graviton Technologies Pvt.Ltd

      V Offline
      V Offline
      varshavmane
      wrote on last edited by
      #2

      What do u want to do??On select index change of combo u want to display the selected employee details or something else??

      1 Reply Last reply
      0
      • P Praveen 123

        Sir, I am developing an application in ASP.NET.It's using a MS-Access database and I am listing ten Emp_IDs from the table Employee to DropdownList.I want to select particular Emp_Name from Employee table on click on DropdownList. Pleas help me to solve this problem.

        Praveen.K System Engineer Graviton Technologies Pvt.Ltd

        S Offline
        S Offline
        Sandeep Akhare
        wrote on last edited by
        #3

        Make the auto post back of drop downlist true and use dropdownlist selectedItem prepertyn in the dropdownlist_selectedIndexchanged function ?

        1 Reply Last reply
        0
        • P Praveen 123

          Sir, I am developing an application in ASP.NET.It's using a MS-Access database and I am listing ten Emp_IDs from the table Employee to DropdownList.I want to select particular Emp_Name from Employee table on click on DropdownList. Pleas help me to solve this problem.

          Praveen.K System Engineer Graviton Technologies Pvt.Ltd

          N Offline
          N Offline
          Naveed Kamboh
          wrote on last edited by
          #4

          Your probelm is not clear when and why you want to select employee , please explain your question. If you are filling dropdownlist use its property autopsotback=true which is false by default. Now use SelectedIndexChange event of your dropdownlist. if you have fetch data from database on the basis of rowselected in the dropdowlist. You have to keep in mind that weahter you are using DataTexFiled property and DataValuefield property of the Dropdownlist if you are using these two then you can query your database like this sql="select * from tbl where field="+ dropdownlist.selectedValue or sql="select * from tbl where field="+ dropdownlist.selectedItem if you are not using these two properties then you can use sql="select * from tbl where field="+ dropdownlist.Text Hope it will help you .

          Naveed Kamboh

          P 1 Reply Last reply
          0
          • N Naveed Kamboh

            Your probelm is not clear when and why you want to select employee , please explain your question. If you are filling dropdownlist use its property autopsotback=true which is false by default. Now use SelectedIndexChange event of your dropdownlist. if you have fetch data from database on the basis of rowselected in the dropdowlist. You have to keep in mind that weahter you are using DataTexFiled property and DataValuefield property of the Dropdownlist if you are using these two then you can query your database like this sql="select * from tbl where field="+ dropdownlist.selectedValue or sql="select * from tbl where field="+ dropdownlist.selectedItem if you are not using these two properties then you can use sql="select * from tbl where field="+ dropdownlist.Text Hope it will help you .

            Naveed Kamboh

            P Offline
            P Offline
            Praveen 123
            wrote on last edited by
            #5

            By using SQLString = "SELECT Name FROM test WHERE ID = +DropDownList1.SelectedValue" I got the selected item from dropdown list.Now how can i place the out put of the query in a DataGrid? i want the syntax or coding? :confused: -- modified at 23:32 Thursday 1st February, 2007

            Praveen.K System Engineer Graviton Technologies Pvt.Ltd

            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