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.
Rickinio
Member
1 Points
5 Posts
Populate DropDown list with Database Tables
Feb 26, 2013 12:21 PM|LINK
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!
ashkc
Participant
960 Points
200 Posts
Re: Populate DropDown list with Database Tables
Feb 26, 2013 12:40 PM|LINK
select name from sys.tables will give you the list of the table names
rajendraram
Participant
812 Points
258 Posts
Re: Populate DropDown list with Database Tables
Feb 26, 2013 12:49 PM|LINK
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"
oned_gk
All-Star
31743 Points
6486 Posts
Re: Populate DropDown list with Database Tables
Feb 26, 2013 01:17 PM|LINK