public static void InitCMB_Shift_All(ComboBox cmb) { cmb.Items.Clear(); cmb.DisplayMember = "DisplayField"; cmb.ValueMember = "ValueField"; wsMDL.IwsMDLClient client = new wsMDL.IwsMDLClient(); try { List<MESParameterInfo> lstParameters = new List<MESParameterInfo>(); List<tmdlshift> lstShift = client.GetShiftList((new BaseForm()).CurrentContextInfo, lstParameters.ToArray<MESParameterInfo>()).ToList<tmdlshift>(); var q = (from p in lstShift orderby p.shift ascending select p); foreach (tmdlshift sf in q) { cmb.Items.Add(new ValueInfo() { DisplayField = sf.shiftname, ValueField = sf.shift }); } } catch (Exception ex) { throw ex; } finally { baseForm.CloseWCF(client); } }