private void LoadProspectType() { FranchisorDAL objFranchisorDal = new FranchisorDAL(); EProspectListType[] objProspectListType = null; var listProspectListType = objFranchisorDal.GetProspectListType(1); if (listProspectListType != null) { objProspectListType = listProspectListType.ToArray(); } DataTable dtProspectListType = new DataTable(); dtProspectListType.Columns.Add("ProspectListTypeID", typeof(Int64)); dtProspectListType.Columns.Add("ProspectListType"); if (objProspectListType != null) { for (int icount = 0; icount < objProspectListType.Length; icount++) { dtProspectListType.Rows.Add(new object[] { objProspectListType[icount].ProspectListTypeID, objProspectListType[icount].ProspectListName }); } } ddlListType.DataSource = dtProspectListType; ddlListType.DataValueField = "ProspectListTypeID"; ddlListType.DataTextField = "ProspectListType"; ddlListType.DataBind(); }