public void BindBatches() { if (!string.IsNullOrEmpty(Convert.ToString(drpFaculty.Text))) { Processing term = new Processing(); drp_Batch.DataSource = term.BindBatch(0, "", Convert.ToInt32(drpFaculty.SelectedValue), 0, 0, 0, Convert.ToInt32(DrpTerm.SelectedValue), "SelectByFaculty", 0, DateTime.Now, DateTime.Now, DateTime.Now, ""); drp_Batch.DataTextField = "BatchCode"; drp_Batch.DataValueField = "Batch_id"; drp_Batch.DataBind(); drp_Batch.Items.Insert(0, new ListItem("Select", "0")); } else { drp_Batch.DataSource = null; drp_Batch.DataBind(); drp_Batch.Items.Insert(0, new ListItem("Select", "0")); } }