public void GetLtaTypes() { Error = ""; var result = new ObjectParameter("Result", typeof(Int32)); var tranDt = new ObjectParameter("TranDT", typeof(DateTime)); LtasList.Clear(); LtasList.Add(""); try { using (var context = new QuoteLogContext()) { var collection = context.usp_QT_Customer_LtaTypes_Get(); foreach (var item in collection) { LtasList.Add(item.LtaType); } _view.cbxLtaType.DataSource = LtasList; } } catch (Exception ex) { Error = (ex.InnerException != null) ? "Failed to return LTA types. " + ex.InnerException.Message : "Failed to return LTA types. " + ex.Message; } }