title: How to access dropdownlist in static method
body: <p>I have the following static method.</p>
  
  <pre><code>public static List&lt;string&gt; GetAutoCompleteData(string StudentId)
      {
              List&lt;string&gt; result = new List&lt;string&gt;();
              using (SqlConnection con = new SqlConnection("Data Source=.;Integrated Security=true;Initial Catalog=SMS"))
              {
                  //using (SqlCommand cmd = new SqlCommand("select  StudentId,StudentName from tblStudent where StudentId LIKE '%'+@SearchText+'%'", con))
                  using (SqlCommand cmd = new SqlCommand("select  T1.StudentName,T1.StudentId from tblStudent T1 where StudentId LIKE '%'+@SearchText+'%' except  select T2.StudentName, T2.StudentId from tblStudentAcademics T2 where T2.AcademicYear='" +Dropdownvalue + "'", con))
                  {
  
                      con.Open();
                      cmd.Parameters.AddWithValue("@SearchText", StudentId);
                      SqlDataReader dr = cmd.ExecuteReader();
                      while (dr.Read())
                      {
                          result.Add(dr["StudentId"].ToString() + "-" + dr["StudentName"].ToString());
                      }
                      return result;
                  }
  
          }
      }
  </code></pre>
  
  <p>I need to write ddlAcadeic.selectedvalue.tostring() in place of Dropdownvalue.Help me</p>