private void fillemployee(int custId) { try { if (ddlcustomer.SelectedIndex > 0) { DataTable dtemp = q.GetEmpNameId(custId); ddlemployee.DataSource = dtemp; ddlemployee.DataTextField = "employee_name"; ddlemployee.DataValueField = "employee_id"; ddlemployee.DataBind(); } else { ddlemployee.DataSource = null; ddlemployee.DataBind(); } ddlemployee.Items.Insert(0, "--Select--"); } catch (Exception ex) { g.ShowMessage(this.Page, ex.Message); } }