Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8818937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:13:45+00:00 2026-06-14T05:13:45+00:00

var todoApp = angular.module(‘TodoApp’, [‘ngResource’]); todoApp.value(‘restTodo’, ‘api/1/todo/:id’); var todoCtrl = todoApp.controller(‘TodoCtrl’, function($scope, $resource, restTodo)

  • 0
var todoApp = angular.module('TodoApp', ['ngResource']);
todoApp.value('restTodo', 'api/1/todo/:id');

var todoCtrl = todoApp.controller('TodoCtrl', function($scope, $resource, restTodo) {
    $scope.src = $resource(restTodo);
    //add & refresh
    $scope.src.save({ content: 'hello world', done: false });
    $scope.todos = $scope.src.get();
    //OR
    //delete & refresh
    $scope.src.delete({ id: '1' });
    $scope.todos = $scope.src.get();
});

When I add/delete item(s) and read the todo list from server again to refresh it. I find that I will hit this error from time to time:

System.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first.

Someone said I can put MultipleActiveResultSets=true; into connect string, but I suspect it will only hide my issue, because the GET is obviously trying to have a dirty read before DELETE can finish its job.

In event based style language, I will naturally call GET after a DELETEComplete() event. However, I am new to AngularJS, I am not sure how it is done here? Please help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T05:13:46+00:00Added an answer on June 14, 2026 at 5:13 am

    I am not a expert, but I would place the read code in the success callback of the save. Something like this:

    var todoApp = angular.module('TodoApp', ['ngResource']);
    todoApp.value('restTodo', 'api/1/todo/:id');
    
    var todoCtrl = todoApp.controller('TodoCtrl', function($scope, $resource, restTodo) {
        $scope.src = $resource(restTodo);
        //add & refresh
        $scope.src.save({ content: 'hello world', done: false }, 
          function(data) {
           $scope.todos = $scope.src.get();
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

var ref1 = new Firebase(http://gamma.firebase.com/myuser/123,456); ref1.set(123,456); var on1 = ref1.on(value, function(snapshot) { console.log(snapshot.val()); });
var Foo = Foo || {}; Foo.Controller = (function ($) { var $page =
var search= document.getElementById('appMenu').value document.location.href= '${createLink(controller: 'application' , action:'ajaxAppSearch', params: ['query': search])}' The element appMenu
var chart; var d = new Array(); function click() { d = document.getElementById('graph:hi').value; alert(d);
var rinlinejQuery = / jQuery\d+=(?:\d+|null)/g, html: function( value ) { if ( value ===
var JavascriptHelper = Backbone.Model.extend(JavascriptHelper, {}, // never initialized as an instance { myFn: function()
var messageSpan; function createFlashMessage = function(message, type, time) { messageSpan || (messageSpan = $(<span>).hide().appendTo(body));
var Model = function(client, collection) { this.client = client; this.collection = collection; }; Model.prototype
var a = true; How to get opposite value of a (false) and vice
var storeSettings = []; obj.find(o_widgetClass).each(function(){ var storeSettingsStr = {}; storeSettingsStr['id'] = $(this).attr('id'); storeSettingsStr['style'] =

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.