I'm not sure i understand you correctly, but i think you want to fetch data from database based on dropdownlist value.
I would not recommend to use query like this:
string qry = "select DISTINCT(App_Code),App_Name
from Appraisal
where year(App_Date)>='"+drdwnyear.SelectedItem.ToString()+"' and YEAR(App_Date)<='"+Next+"'";
because of
SQL Injection[
^].
More:
How To: Protect From SQL Injection in ASP.NET[^]
SQL Injection and how to avoid it[^]
Do Stored Procedures Protect Against SQL Injection?[^]
Rather then above query, use parametrized query:
string qry = "select DISTINCT(App_Code),App_Name
from Appraisal
where year(App_Date)>=@currYear and YEAR(App_Date)<=@currYear+1";
Now, create
SqlCommand[
^] and add
@currYear
parameter to the
SqlParametersCollection[
^]
aSqlCommand.Parameters.AddWithValue("@currYear", DropDownList.SelectedValue);
Follow the links to see sample code.