public void GetTerms() { Error = ""; var result = new ObjectParameter("Result", typeof(Int32)); var tranDt = new ObjectParameter("TranDT", typeof(DateTime)); TermsList.Clear(); TermsList.Add(""); try { using (var context = new QuoteLogContext()) { var collection = context.usp_QT_Customer_Terms_Get(); foreach (var item in collection) { TermsList.Add(item.Term); } _view.cbxTerms.DataSource = TermsList; } } catch (Exception ex) { Error = (ex.InnerException != null) ? "Failed to return terms. " + ex.InnerException.Message : "Failed to return terms. " + ex.Message; } }