This error can show up if you execute a query while iterating over the results from another query, but from your example its not clear if this is the actual issue.
Allowing MARS in your connection string may solve the issue. Add
Two commonly used methods for a request-response between a client and server are: GET and POST.
GET - Requests data from a specified resource
POST - Submits data to be processed to a specified resource
GET is basically used for just getting (retrieving) some data from the server.
Note: The GET method may return cached data.
POST can also be used to get some data from the server. However, the POST method NEVER caches data, and is often used to send data along with the request.
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
211 Points
898 Posts
Error-There is already an open DataReader associated with this Command which must be closed first...
Apr 14, 2017 03:06 PM|JagjitSingh|LINK
Hi
Below is the code
Thanks
Participant
1050 Points
319 Posts
Re: Error-There is already an open DataReader associated with this Command which must be closed f...
Apr 14, 2017 03:55 PM|deepalgorithm|LINK
This error can show up if you execute a query while iterating over the results from another query, but from your example its not clear if this is the actual issue.
Allowing MARS in your connection string may solve the issue. Add
to the provider part of your connection string.
Member
211 Points
898 Posts
Re: Error-There is already an open DataReader associated with this Command which must be closed f...
Apr 14, 2017 04:12 PM|JagjitSingh|LINK
Hi
I am getting server error 500
Participant
1050 Points
319 Posts
Re: Error-There is already an open DataReader associated with this Command which must be closed f...
Apr 14, 2017 04:17 PM|deepalgorithm|LINK
Thats an internal server error. Where is the error happening? What line of code specifically?
Star
8500 Points
2883 Posts
Re: Error-There is already an open DataReader associated with this Command which must be closed f...
Apr 17, 2017 02:11 AM|Cathy Zou|LINK
Hi JagjitSingh,
Two commonly used methods for a request-response between a client and server are: GET and POST.
GET is basically used for just getting (retrieving) some data from the server. Note: The GET method may return cached data.
POST can also be used to get some data from the server. However, the POST method NEVER caches data, and is often used to send data along with the request.
https://www.w3schools.com/jquery/jquery_ajax_get_post.asp
For your 500 error: you could change your request type to Post and ensure that the Controller Action is decorated with the [HttpPost]
attribute, indicating it should be used for POST calls :
Besides, you could read the correct reply in the following link to check your code:
http://stackoverflow.com/questions/36894273/jquery-ajax-call-to-pass-json-array-in-mvc-500-internal-server-error
Best regards
Cathy
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.