title: Dropdownlist not giving selected value
body: <p>I had this aspx source code</p>
  
  <pre><code>&lt;tr&gt;
              &lt;td&gt;MatchName&lt;/td&gt;
              &lt;td&gt;
                  &lt;asp:DropDownList ID="ddlMatchName" runat="server"&gt;
                  &lt;/asp:DropDownList&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Winning Team&lt;/td&gt;
              &lt;td&gt;
                  &lt;asp:DropDownList ID="ddlWinningTeam" runat="server"&gt;
                  &lt;/asp:DropDownList&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;Score&lt;/td&gt;
              &lt;td&gt;
                  &lt;asp:TextBox ID="txtScore" runat="server"&gt;&lt;/asp:TextBox&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;asp:Button ID="btnSave" runat="server" Text="Save"  OnClick="btnSave_Click" /&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;asp:Button ID="btnCancel" runat="server" Text="Cancel" OnClick="btnCancel_Click" /&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
  </code></pre>
  
  <p>C# Code  </p>
  
  <pre><code> protected void Page_Load(object sender, EventArgs e)
      {
          string queryMatchDetail = "select MatchId,MatchName from ADMMasterMatch order by MatchDate";
          ddlMatchName.DataSource = clsNewSqlFunctions.GetSelectedData(queryMatchDetail);
          ddlMatchName.DataTextField = "MatchName";
          ddlMatchName.DataValueField = "MatchId";
          ddlMatchName.DataBind();
  
          string queryTeamDetail = "SELECT [TeamId],[TeamName] FROM [AdmCurrentEventMasterTeam] order by TeamName";
          ddlWinningTeam.DataSource = clsNewSqlFunctions.GetSelectedData(queryTeamDetail);
          ddlWinningTeam.DataTextField = "TeamName";
          //ddlWinningTeam.DataValueField = "TeamId";
          ddlWinningTeam.DataBind();
  
      }
  
      protected void btnSave_Click(object sender, EventArgs e)
      {
          var s = ddlMatchName.SelectedIndex;
          string query = "UPDATE [ADMMasterMatch] SET Winner = '" + ddlWinningTeam.SelectedItem.Text + "' , Score = '" + txtScore.Text + "' Where MatchId ='" + ddlMatchName.SelectedItem.Text +"'";
          clsNewSqlFunctions.ExecuteQuery(query);
      }
      protected void btnCancel_Click(object sender, EventArgs e)
      {
          Response.Redirect("ADMCurrentEventMatchResult.aspx");
      }
  </code></pre>
  
  <p>Here <code>clsNewSqlFunctions.ExecuteQuery()</code> and  clsNewSqlFunctions.GetSelectedData() are method to execute query and select data which return data in form of dataset    </p>
  
  <p>on <code>Save_Click</code> event i am updating data on database from selected value of dropdown list but it is not showing me selected value<br>
  It always show value at index 0. on <strong>SelectedText,SelectedItem</strong><br>
  please help me what is wrong with my code  </p>