title: dropdownlist selected value
body: <p>This may seem very trivial, I used to know how to do this at one time but for some reason I can't seem to get my head around it this time:</p>
  
  <p>I have two tables: <code>Hotel</code> and <code>HotelRooms</code>
  The <code>Hotel</code> table has <code>HotelID</code> and other hotel details and the <code>HotelID</code> is found in <code>HotelRooms</code> with different roomtypes, each roomtype has a description.
  One Hotel can have many rooms types. </p>
  
  <p>I have a <code>DropDownList</code> that contains <code>HotelID</code> and <code>RoomIDs</code>. <code>HotelID</code> comes from a session variable. <code>HotelID</code> is the value for the <code>DropDownList; but the list displays</code>RoomType<code>. 
  When</code>Roomtypes<code>are selected I want to display a</code>GridView` with the hotel room details like description, price etc.... </p>
  
  <p>I can't do this because the value for my DropDownList is <code>HotelID</code> which is mapped to the <code>Session ID</code>. How do I get the HotelRoom details from the selected value of the DropDownList, please?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>Code for Gridview:</p>
  
  <pre><code>        string intResortID = Request.QueryString("intResortID ")
          string strRoomType = DropDownList2.SelectedValue;
          string connStr = ConfigurationManager.ConnectionStrings["bdsConnectionString"].ConnectionString;
          SqlConnection Con = new SqlConnection(connStr);
          SqlDataAdapter sdr = new SqlDataAdapter("SELECT TOP (100) PERCENT tblAvail.dtm, tblResortsRooms.strRoomType, tblResortsRooms.strDescription, tblAvail.intQty, tblAvail.curPrice, tblAvail.intResortID, tblResortsRooms.intWSCode FROM tblAvailable INNER JOIN tblResortsRooms ON tblAvail.intResortID = tblResortsRooms.intResortID AND tblAvail.strRoomType = tblResortsRooms.strRoomType WHERE (tblResortsRooms.curRecRate &gt; 0) AND (tblAvail.intResortID = @intResortID) AND (tblAvail.strRoomType = @strRoomType) AND (tblAvailable.dtm &gt;= { fn CURDATE() }) ORDER BY tblResortsRooms.strRoomType",Con);
          SqlParameter ResID = new SqlParameter("@intResortID", intResortID);
          SqlParameter RoomType = new SqlParameter("@strRoomType", strRoomType);
          sdr.SelectCommand.Parameters.Add(ResID);
          sdr.SelectCommand.Parameters.Add(RoomType);
  </code></pre>
  
  <p>
          
          
          </p>
  
  <pre><code>      &lt;asp:DropDownList ID="DropDownList2" runat="server" 
          DataSourceID="SqlDataSource2" DataTextField="strRoomType" 
          DataValueField="intResortID" 
          onselectedindexchanged="DropDownList2_SelectedIndexChanged" 
          AutoPostBack="True"&gt;
      &lt;/asp:DropDownList&gt;
      &lt;asp:SqlDataSource ID="SqlDataSource2" runat="server" 
         SelectCommand="SELECT [intResortID], [strRoomType] FROM [tblResortsRooms] WHERE ([intResortID] = @intResortID)"&gt;
          &lt;SelectParameters&gt;
              &lt;asp:ControlParameter ControlID="DropDownList1" Name="intResortID" 
                  PropertyName="SelectedValue" Type="Int32" /&gt;
          &lt;/SelectParameters&gt;
      &lt;/asp:SqlDataSource&gt;
  </code></pre>