This error occurs when a new request is executed when you are inside another request. Do you have something like this in your view
@Html.DisplayFor(modelItem => item.Device.Name)
and in your device model you have
public string Name { get { return String.Format("{0} {1}", Brand.BrandName, Model.ModelName); } }
then, for evaluating Device.Name you need to request its Brand and Model, it will become a request inside the request, and therefore the solution should include MutlipleActiveResultSets in the database connection string as follows:
<add name="MyDBContext" connectionString="Data Source=.;Initial Catalog=mydb;Integrated Security=True;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
Mohsen afshin
source share