title: Error: "Calling 'Read' when datareader is closed...."
body: <p>Here is the code from my View:</p>
  
  <pre><code>@model IEnumerable&lt;Sample2.Models.Leave_GetDetails_Result1&gt;
  
  @{
      ViewBag.Title = "Index";
  }
  
  &lt;div&gt;
      @foreach (var item in Model) { 
      &lt;dl class="dl-horizontal"&gt;
          &lt;dt&gt;
              @Html.DisplayNameFor(model =&gt; model.LA_StaffCode)
          &lt;/dt&gt;
  
          &lt;dd&gt;
              @Html.DisplayFor(model =&gt; item.LA_StaffCode)
          &lt;/dd&gt;
  
          &lt;dd&gt;
              @Html.DisplayFor(model =&gt; item.LA_AppNo)
          &lt;/dd&gt;
      &lt;/dl&gt;
      }
  &lt;/div&gt;
  &lt;p&gt;
      @*@Html.ActionLink("Edit", "Edit", new { id = Model.Staff_Code }) |*@
      @Html.ActionLink("Back to List", "Index")
  &lt;/p&gt;
  </code></pre>
  
  <p>When I execute, it gives error: </p>
  
  <pre><code>"Calling 'Read' when datareader is closed is not a valid operation"
  </code></pre>
  
  <p>Edited:</p>
  
  <p>The Controller code is below where I am calling a stored procedure:</p>
  
  <pre><code>using (var context = new Admin_TestEntities())
  {
      var data = context.Leave_GetDetails("Recommended");
      return View(data.AsEnumerable());
  }
  </code></pre>