title: Passing parameters to SQLDataSource
body: <p>I have two Drop Down Lists, degrees and programs respectively, i want to generate the program list values on the bases of selected Degree from degree dropdown list. how can i do this, the code is given below:</p>
  
  <pre><code>&lt;asp:DropDownList ID="Degree_DList" runat="server" DataSourceID="Degrees_DropdownList" 
  DataTextField="DEGREE_NAME" DataValueField="DEGREE_ID" AppendDataBoundItems="True"&gt;
  &lt;/asp:DropDownList&gt;
  
  &lt;asp:SqlDataSource ID="Degrees_DropdownList" runat="server" ConnectionString="&lt;%$ ConnectionStrings:admConnectionString %&gt;" ProviderName="&lt;%$ ConnectionStrings:admConnectionString.ProviderName %&gt;" 
  SelectCommand="SELECT DEGREE_ID, DEGREE_NAME FROM DEGREE"&gt; &lt;/asp:SqlDataSource&gt;
  
  &lt;asp:DropDownList ID="Program_Dlist" runat="server" AppendDataBoundItems="True" DataSourceID="Programs_DropdownList" DataTextField="PROGRAM_NAME" DataValueField="PROGRAM_ID"&gt;&lt;/asp:DropDownList&gt;
  
  &lt;asp:SqlDataSource ID="Programs_DropdownList" runat="server" ConnectionString="&lt;%$ ConnectionStrings:admConnectionString %&gt;" ProviderName="&lt;%$ ConnectionStrings:admConnectionString.ProviderName %&gt;" 
  SelectCommand="SELECT PROGRAM_ID, PROGRAM_NAME FROM PROGRAMS WHERE DEGREE_ID = @DEGREE_ID"&gt;&lt;SelectParameters&gt;
  &lt;asp:ControlParameter Name="DEGREE_ID" ControlID="Degree_DList" PropertyName="SelectedValue" /&gt;
  &lt;/SelectParameters&gt;
  &lt;/asp:SqlDataSource&gt;
  </code></pre>