public void deletecanLV(string query)
    {
        if (con.State != ConnectionState.Open)
        {
            con.Open();
        }
        SqlDataAdapter da = new SqlDataAdapter(query, con);

        DataTable dt = new DataTable();

        da.Fill(dt);
        DeleteCandidateLV.DataSource = dt;
        DeleteCandidateLV.DataBind();
        con.Close();
    }
 protected void DeleteCandidateLV_PagePropertiesChanging(object sender, PagePropertiesChangingEventArgs e)
 {
     (DeleteCandidateLV.FindControl("DataPager1") as DataPager).SetPageProperties(e.StartRowIndex, e.MaximumRows, false);
     deletecanLV("select * from Add_Candidate where isActive = 0");
 }