This question is related to this:
My repository method has this code:
public IEnumerable GetApplicationPositionHistor
This error happens when a new query is going to be executed while you're in inside another query. Consider 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 since for evaluating Device.Name it requires to query its Brand and Model it will become query inside query and so the solution is to enable MutlipleActiveResultSets in your database connection string as follows: