November 15th, 2010, 12:38 AM
Implementing cascading Drodown List with CSharp
I m trying to implemnt cascading drodown lists.
I have a database where it has to retrieve the information from the tables.e.g I have two tables in the database-Country table(Country ID ,country name) and second table which is Logo(logon ID,logo name,CountryID).The country ID here is the foreign key in the logo table.
In my dropdownlist1,I populate the country names from the table Country,so here is what I have to do, I have to see what user selects in the dropdownlist 1 (Name of the country),then I go to the databse ,extract the country ID corresponding to the country name the user selected from country table and then again go to the Logo table and look for that country ID and find the corresponding logo for that country and then display it in the second dropdown list specific to that country only.
So I need some kind of sql command in the /aspx file. I am able to get data in the firstt dropdown ,(using select command)I am thinking I store that value in a variable in aspx.cs file and then I write a query with WHERE condition which is the value user selected. I just can't figure out how to take the input frm the user,extract the information from database rand then diplay it.how to make this variable pass the value to the Sql command in my .aspx file.Please help!!
I am using VB Ultimate 2010,web froms
Tags for this Thread
Click Here to Expand Forum to Full Width