c# - Open DataReader which must be closed first -
- net 4.5
I get the error above (subject line) I'm stationed on the production server and iterate at Places in the precursor. To make it work on the production server, give me an array i.e. var locationArray = locations.ToArray (); and had to iterate locationArray .
So my question is in the test (running local while debugging in VS2013) I am running against a SQLExpress frequency and in the production I am running against fully developed SQLServer. However, why does not iterate places , but an error occurs in the trial but does it produce?
Public IQueryable & lt; State & gt; StatescountryGate (long account id) {list & lt; State & gt; Results = New list & lt; State & gt; (); (Using DataRegistry Data Repository = Data Registry. Instance ()) {// # TODO: Find a Better Way to Make IQueryable by Group & lt; LocationsMapping & gt; Locations = dataRepository.Query & lt; LocationsMapping & gt; (R = & gt; R. CountyId == aCountryId); Var locationare = Places. ToArray (); // Why do I need to do this? Foreach (mapping in location mapping location locationArray) {// If we do not already have it, add state (result.example (R => RIID == location mapping statet)) {result.Add (locationMapping .State); }}} Return Results ANALIMABLE (); }
Different database versions have different features, and tools such as ORM often have their Code is tailor-made to take advantage of specific differences, for example, it is a bad idea to test a very different version of a actually . I strongly suggest that you use the developer version Develop against
Calling
ToArray () emphasizes repetition to fully evaluate (at the end of the sequence) to avoid parallel readers immediately on a connection, it is actually a It is very common.
For why: Perhaps you (Mars) have enabled one but not the other; Or perhaps it is known that Mars is not available on ever express, so it does not try - but it thinks that MARS may be available on full SQL Server, Then tries to use it
Comments
Post a Comment