dropdownlist selected index changed in asp.net using C#
<p>I have 2 drop down list.</p>

<ul>
<li>First for city and</li>
<li>second for state</li>
</ul>

<p>I want to fill the state list when the city is selected...</p>

<p>I'm using the code</p>

<pre><code>protected void Ddl_SelectedIndexChanged(object sender, EventArgs e)
    {

        String sqlQuery="select SM.StateId,StateName From StateMast SM,CityMast CM where CM.StateId=SM.StateId AND CM.CItyId='"+ Convert.ToInt16(DdlCity.SelectedValue.ToString())+"'";

        DdlState.DataSource = cls.Select(sqlQuery);
        DdlState.DataTextField = "StateName";
        DdlState.DataValueField = "StateId";
    } 
</code></pre>

<p>but nothing is happing on selecting city...</p>

<p>I have set the autopostback of <code>city=true</code>..</p>

<p>Select is a function which is returning data table</p>

<pre><code>public DataTable Select(String sqlQuery)
   {       
       con.Open();
       SqlDataAdapter adapter = new SqlDataAdapter(sqlQuery,con);
       DataTable table = new DataTable();
       adapter.Fill(table);
       con.Close();
       return table;
   }
</code></pre>
