title: how to bind data to the dropdownlist on selected value of the other dropdownlist in asp.net?? I have already bind data to the all the dropdown
body: <p>//.aspx.cs code:</p>
  
  <pre><code>protected void ddldistrict_SelectedIndexChanged(object sender, EventArgs e)
  {
      try {
          ddltaluka.Enabled = true;
          string d1 = ddldistrict.Text;
          NpgsqlConnection conn = new NpgsqlConnection("Server=localhost;Port=5432;User Id=postgres;Password=*******;Database=guj_data;");
          conn.Open();
          string sql = "SELECT tname FROM taluka_geo_bnd_box WHERE district='"+d1+"'";
          NpgsqlDataAdapter da = new NpgsqlDataAdapter(sql, conn);
  
          ds.Reset();
          da.Fill(ds);
          dt = ds.Tables[0];
          ddltaluka.DataSource = ds;
          ddltaluka.DataTextField = "tname";
          ddltaluka.DataBind();
  
          conn.Close();
        }
      catch(Exception e3)
      {
          throw e3;
      }
  }
  protected void ddltaluka_SelectedIndexChanged(object sender, EventArgs e)
  {
      try { 
      ddlvillage.Enabled = true;
      string t1 = ddltaluka.Text;
      string d1 = ddldistrict.Text;
      NpgsqlConnection conn = new NpgsqlConnection("Server=localhost;Port=5432;User Id=postgres;Password=*****;Database=guj_data;");
      conn.Open();
      string sql = "SELECT vname FROM village_boundary_geo_bnd_box WHERE tname='"+t1+"' AND district='"+d1+"'";
      NpgsqlDataAdapter da = new NpgsqlDataAdapter(sql, conn);
  
      ds.Reset();
      da.Fill(ds);
      dt = ds.Tables[0];
      ddlvillage.DataSource = ds;
      ddlvillage.DataTextField = "vname";
      ddlvillage.DataBind();
  
      conn.Close();
    }
      catch(Exception e4)
      {
          throw e4;
      }
  }
  </code></pre>