i have written this in else condition ..can anyone please check this...
else
if (DDlDepartment.SelectedValue != null && DDLStaffid.SelectedValue != null)
{
con.Open();
string str1 = DDlDepartment.SelectedValue;
string str2 = DDLStaffid.SelectedValue;
SqlDataAdapter ad1 = new SqlDataAdapter("Select * from ManstaSalary where Department='" + str1 + "'and StaffID= '" + str2 + "'", con);
DataSet ds1 = new DataSet();
ad1.Fill(ds1);
GridView1.DataSource = ds1;
GridView1.DataBind();
con.Close();
}