Hi
You have 3 table for example:
Country{id,name,region}
State{id,country_id,name} look at country_id is a foreign key for the Country table
city{id,state_id,name,time} look at state_id is a foreign key for the State table
Now we want to the bind Country table to ddl_country of course I assume you are fill the CountryDataTable:
ddl_country.DataTextField ="name"
ddl_country.DataValueField ="id"
ddl_country.DataSource= CountryDataTable;
ddl_country.DataBind();
After that you should bind the ddl_city for do that you should go to the ddl_country
SelectedIndexChanged
event and write this code:
ddl_city.DataTextField ="name"
ddl_city.DataValueField ="id"
strsql = "select * from city where country_id=' " & ddl_country.SelectedValue& "'";
ddl_city.DataSource = CityDataTable;
ddl_city.DataBind();
and you can do this work for other ddl and lab lab lab ... ;)
Please follow of this link for get a sample:
How to fill the second combobox on depending on the selectedvalue of the first[
^]
It is really good sample for this purpose:
http://www.dotnetfunda.com/forums/thread9657-binding-one-dropdownlist-to-another-dropdownlist.aspx[
^]
Best Regards.