private void fillAccomodationPriority(ListBox ddl) { lookupAttributeDAL LookupAtrributes = new lookupAttributeDAL(); MDMSVC.DC_M_masterattributelists list = LookupAtrributes.GetAllAttributeAndValuesByFOR("Accommodation", "Priority"); try { list.MasterAttributeValues = list.MasterAttributeValues.OrderBy(x => Convert.ToInt32(x.AttributeValue)).ToArray(); } catch { } ddl.Items.Clear(); ddl.DataSource = list.MasterAttributeValues; ddl.DataValueField = "AttributeValue"; ddl.DataTextField = "OTA_CodeTableValue"; ddl.DataBind(); }