title: Pass selected value from drop down box in select statement using C#
body: <p>I have drop down that shows the location name and the data source for the drop down brings both the LOC_NM and LOC_ID but the user will see only the Location Name.  So what I want to do is pass the LOC_ID in my select query, how would I do that?
  Here is the code for the drop down:</p>
  
  <pre><code>&lt;asp:DropDownList ID="locatioin"  DataSourceID="dd_source" DataTextField="LOC_NM" DataValueField="LOC_ID" runat="server" AppendDataBoundItems="true"&gt;
  &lt;asp:ListItem Text="Select Location" Value="Select Location"&gt;&lt;/asp:ListItem&gt;
  &lt;/asp:DropDownList&gt;
  </code></pre>
  
  <p>and here is the code behind for my select statement:</p>
  
  <pre><code> SqlDataAdapter da = new SqlDataAdapter("select Company, Location from MainTable
      where Location = selected LOC_ID")
  </code></pre>
  
  <p>as you can see i want to pass the LOC ID for the selected value in my query but i am having trouble with that: where Location = selected LOC_ID</p>