thank you or ypur advice
but i am developing web application using C#,just look at my code which is giving error message...
if (Page.IsPostBack == false)
{
SqlConnection con = new SqlConnection("user id=sa;password=vubrain;database=raghu;data source=vubrain4");
SqlDataAdapter da = new SqlDataAdapter("select countyr_id,countryname from country_master", con);
DataSet ds1 = new DataSet();
da.Fill(ds1, "country_master");
dd1.DataSource = ds1.Tables["country_master"];
dd1.DataTextField = "countryname";
dd1.DataValueField = "countyr_id";
dd1.DataBind();
}
}
protected void dd1_SelectedIndexChanged(object sender, EventArgs e)
{
string countryid;
countryid = dd1.SelectedValue;
SqlConnection con = new SqlConnection("user id=sa;password=vubrain;database=raghu;data source=vubrain4");
SqlDataAdapter da1 = new SqlDataAdapter("SELECT stateid,statename FROM countrystate");
DataSet ds1 = new DataSet();
da1.Fill(ds1, "countrystate");
dd2.DataSource = ds1.Tables["countrystate"];
dd2.DataTextField = "statename";
dd2.DataValueField = "stateid";
dd2.DataBind();
}
protected void dd2_SelectedIndexChanged(object sender, EventArgs e)
{
string stateid;
stateid = dd2.SelectedValue;
}
If i want to select any country from 1st dropdownlist then,2nd dropdownlist should populate with all the state of that paticular country only and if we select any state from 2nd dropdown then the capital should be placed in text box beside that and so on...