Home > Cannot Be > Query Results Cannot Be Enumerated

Query Results Cannot Be Enumerated

Contents

Can I substitute decaf coffee for espresso Polyglot Anagrams Cops' Thread How often should I replace windscreen wiper blades? Why did Borden do that to his wife in The Prestige? I realize the debugger is telling me that I cannot page this collection in this fashion. See Trademarks or appropriate markings. check over here

Why do languages require parenthesis around expressions when used with "if" and "while"? How to reply? IEnumerable should only be used if you are processing the data once, and might not even be processing all of it. asked 5 years ago viewed 56997 times active 1 year ago Upcoming Events 2016 Community Moderator Election ends Nov 22 Visit Chat Linked 4 LINQ : The query results cannot be http://stackoverflow.com/questions/5723555/the-result-of-a-query-cannot-be-enumerated-more-than-once

The Result Of A Query Cannot Be Enumerated More Than Once Store Procedure

So change IEnumberable to List and make any other relevant changes. ClickHERE to participate the survey. Why is looping over find's output bad practice? Join them; it only takes a minute: Sign up The result of a query cannot be enumerated more than once Exception up vote 2 down vote favorite I'm trying to retrieve

more hot questions question feed lang-cs about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation Daniel Admin 2113 posts Posted 09 Dec 2013 Link to this post Hello, You should use a POST request when sending JSON: read: { url: "/Search/Search_Read", type: "POST", dataType: "json", data: Thanks! The Query Results Cannot Be Enumerated More Than Once. Linq To Sql What is the most someone can lose the popular vote by but still win the electoral college?

Boss sends a birthday message. Change foreach (var item in query) to foreach (var item in query.ToList()) share|improve this answer answered Apr 19 '11 at 22:47 Yakimych 12.7k43558 2 That worked! Is it possible for an diesel engine computer to detect (and prevent) a runaway condition? http://stackoverflow.com/questions/23876472/the-result-of-a-query-cannot-be-enumerated-more-than-once-exception Everything query's perfectly on the first loop but on the second when I try to skip past the previous query results I'm getting an The result of a query cannot be

A39.1K Updated 5-Apr-11 14:37pm v2 Comments Henry Minute 5-Apr-11 20:08pm Sounds reasonable to me! +5 Add a Solution Add your solution here B I U S small BIG code The Result Of A Query Cannot Be Enumerated More Than Once. Iqueryable If you only call .ToList once and store the result, the problem should go away. Oracle SQL - can I return the "before" state of a column value How can I take a powerful plot item away from players without frustrating them? This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL) Top Experts Last 24hrsThis month Peter Leow 185 OriginalGriff 160 F-ES

The Result Of A Query Cannot Be Enumerated More Than Once Entity Framework

the query is passed on to the back-end provider). Previous Question Related to this one What I am attempting to do is iterate over a collection returned from the entity framework via a sproc. The Result Of A Query Cannot Be Enumerated More Than Once Store Procedure i try to solve this error but its not fix when this error hase comes. The Result Of A Query Cannot Be Enumerated More Than Once Mvc Wrong way on a bike lane?

Or rather than changing the method's return type, you can call ToList on it when you use it and use the returned List instead. Linux questions C# questions ASP.NET questions fabric questions SQL questions discussionsforums All Message Boards... Teenage daughter refusing to go to school How can I take a powerful plot item away from players without frustrating them? Why is looping over find's output bad practice? The Result Of A Query Cannot Be Enumerated More Than Once. Objectresult

Why is looping over find's output bad practice? View All Messages No new notifications. What is the most efficient & fastest way to speed up the installation of packages with thousands of items? this content We are trying to better understand customer views on social support experience.

Application Lifecycle> Running a Business Sales / Marketing Collaboration / Beta Testing Work Issues Design and Architecture ASP.NET JavaScript C / C++ / MFC> ATL / WTL / STL Managed C++/CLI Objectresult To List Not only don't I see a problem with the solution, but also it is the best possible way to solve the OP's problem. If you need to iterate the data more than once then IEnumerable is a very bad choice of data structure.

more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed

How to prove that authentication system works, and that customer uses the wrong password? Wrong way on a bike lane? It's not clear how the last block of code relates to your question. –spender Mar 11 '13 at 14:22 add a comment| 3 Answers 3 active oldest votes up vote 5 Nullable Object Must Have A Value. What now?

There are similar issues with it. Why did Borden do that to his wife in The Prestige? As this returs an IEnumerable so it can be iterated only once i.e in a lazy way. have a peek at these guys Oracle SQL - can I return the "before" state of a column value Wrong way on a bike lane?

Can Trump undo the UN climate change agreement? c# linq share|improve this question edited Apr 23 '13 at 12:58 walther 10.2k42757 asked Apr 23 '13 at 12:55 8611670474 681111 marked as duplicate by mellamokb, walther, bash.d, Andrew Whitaker, Habib It doesn't "remember" that you took a certain number of items the next time you call .Take on it - it will always start from the beginning again. Permalink Posted 5-Apr-11 14:29pm Karthik.

Your Email This email is in use. Browse other questions tagged c# task-parallel-library async-await or ask your own question. more hot questions question feed default about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation US Election results 2016: What went wrong with prediction models?

Mimsy were the Borogoves - why is "mimsy" an adjective? Member 150 Points 33 Posts Re: The result of a query cannot be enumerated more than once Dec 03, 2013 08:02 AM|anand.uchagawkar|LINK This might happen when you try to write an share|improve this answer answered Aug 6 '13 at 21:09 D Stanley 105k974126 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google What is the most efficient & fastest way to speed up the installation of packages with thousands of items?

If so, you could use MoreLinq's Batch extension. (See Create batches in linq for more info about Batch.) I don't know if using Batch would avoid the need for .ToList(), but Boss sends a birthday message. Solution 1 Accept Solution Reject Solution It's pretty tough to say why without seeing all of your code. what does getagentdetailsbystate do?