Tuesday, April 8, 2014

Get Data Using Entity Framework

  1. Use the following method as reference to get the data from Database.

    public List<tbl_M_EventLog> GetEventLog()
            {
                List<tbl_M_EventLog> objEventLog = null;
                try
                {
                    objEventLog = DBConnection.Entities.tbl_M_EventLog.OrderByDescending(T => T.EventLogId).ToList();
                }
                catch (Exception ex)
                {
                               }
                return objEventLog;
            }

No comments:

Post a Comment