score:4
Accepted answer
it is because objectresult<t>
internally accesses datareader
which allows enumerating result only once in forward only way so if you want to iterate the result again without calling tolist
first you must execute stored procedure again and get new objectresult<t>
instance.
Source: stackoverflow.com
Related Query
- Enumerating stored procedure result - The result of a query cannot be enumerated more than once
- The result of a query cannot be enumerated more than once when using stored procedure
- The result of a query cannot be enumerated more than once
- How to get a single object by LINQ? ERROR: The result of a query cannot be enumerated more than once
- The result of a query cannot be enumerated more than once.
- LINQ : The query results cannot be enumerated more than once
- Stored Procedure & LINQ, Dmbl File unable to interpret the result set
- How to apply Where, Select, OrderBy and so on to the result of a stored procedure in LinqPad?
- convert the paramater's date type to varchar , of stored procedure in linq query
- error: The query results cannot be enumerated more than once
- LINQ error : The query results cannot be enumerated more than once
- Can I assign the result of a Linq query to the source variable of the same query?
- Is there a code that allows me to get the result of the following sql query in linq?
- Linq query in stored procedure result set Ado.Net
- Entity Framework Code First - The entity or complex type cannot be constructed in a LINQ to Entities query
- Reuse stored procedure result in linq to sql in Code First
- Local sequence cannot be used in LINQ to SQL implementation of query operators except the Contains() operator
- Could not find an implementation of the query pattern for source type 'System.Data.Entity.DbSet'
- LINQ To SQL exception: Local sequence cannot be used in LINQ to SQL implementation of query operators except the Contains operator
- why is this linq query return a boolean and not the first result of the select?
- How to execute stored procedure and get return result in MVC/EF/LINQ
- The entity or complex type ... cannot be constructed in a LINQ to Entities query
- Paging in the stored procedure
- Is there any way to create a LINQ query as a variable without having the data source (yet)?
- Creating objects from stored procedure result
- Will the result of a LINQ query always be guaranteed to be in the correct order?
- The entity or complex type cannot be constructed in a LINQ to Entities query
- How can I write the following code more elegantly using LINQ query syntax?
- The given value of type String from the data source cannot be converted to type int of the specified target column
- C# Using LINQ Query compare the records with result of process array
More Query from same tag
- “A cycle was detected in the set of changes” with Linq to SQL
- What is the equivalent argument matcher for a parameter like this - "Expression<Func<TEntity, bool>> predicate)" in NSubsitute?
- How to retrieve data from multiple tables that may or may not have values in common
- Linq Lambda expression for scalar value (max)
- mongoDB run queries just like as SQL !
- How to limit searching characters if I use LINQ
- Poor performance comparing collections of objects using reflections and Linq Except/Intersect
- How do I optimize this SharePoint query for Terms?
- Merging result of two queries
- Linq Query to get two different values from a single list
- Invalid case exception
- Linq to select objects where children have no associated children
- How to get the 'type name' of an derived entity within LINQ statement : "does not recognize the method 'System.Type GetType()"
- Eliminating Loop in LINQ to Entities
- Make ObservableCollection class with LINQ
- Sorting a list using Lambda/Linq to objects
- How to select columns and sum of columns using group by keyword from data table in c#
- Building combobox with Linq - giving error because multiple entries for same key
- C# Sequence selection
- Simplify loop to get the attributes of a class
- c# linq list one item could have two values based on another item
- Comparing two collections of objects
- Complex SQL JOIN Query, min, max and date range
- Linq Query toList() is empty but foreach works
- Lambda expression Group by in C#
- set-like products of ranges for queries etc
- Entity Framework - Filter LINQ by ICollection type using TPH
- LINQ order by a number sequence
- Unable to sort with property name in LINQ OrderBy
- How do you manually construct a lambda expression?