instead of an "object" datatype, you can use the IQueryable type.
This will also directly bind to a DataGridView.Code:public IQueryable SelectAllEmployees() { using(DatabaseContext dbContext = new DatabaseContext()) { var assocQuery = dbContext.SelectAllAssociates // accessing stored procedure. return assocQuery.AsQueryable(); } }




Reply With Quote