locked
Populate DropDown list with Database Tables RRS feed

  • Question

  • User1899999457 posted

    Hello,

    I want to populate a DropDown list with some Tables inside an SQL Server Database.

    Further more the table names are SYS_GEO_GR, SYS_GEO_UK, SYS_GEO_US  etc and i want to display them on the DropDown not like this but as Greece, United Kingdom, United States etc.

    Can you please assist me on this one.

    Thanks in advance for your help!

    Tuesday, February 26, 2013 8:21 AM

Answers

  • User1221318268 posted

    select name from sys.tables will give you the list of the table names

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 26, 2013 8:40 AM

All replies

  • User1221318268 posted

    select name from sys.tables will give you the list of the table names

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, February 26, 2013 8:40 AM
  • User191287084 posted

    what u mean? 

    Please use two table 

    1)Country

    2)State

    and set foriegn key reference in contry to stat table

    the u want get all country. use below query for

    select * from country// Get all country

    you want state

    select * from state//get all states

    you want states for  selected country 

    select * from state where countryId="US"

    Tuesday, February 26, 2013 8:49 AM
  • User-1716253493 posted
    create another table containing the code and name
    Tuesday, February 26, 2013 9:17 AM