I am getting the above error when i retreived the data from the Datacontext Model.
it is happening now and then also.
I am getting the above error when i retreived the data from the Datacontext Model.
it is happening now and then also.
You have forget to close the DataReader, and you start one more DataReader on the same connection.
Ensure that you're not declaring your DataContext as static
. Create and destroy your DataContext on each use.
public MyDataClass{
CustomerDataContext db;
public void MyDataClass()
{
db = new CustomerDataContext();
}
public Customer GetCustomer(int id)
{
return db.Customers.SingleOrDefault(c=>c.ID == id);
}
}
Check this post
It realy depends how you store, access and dispose the datacontext. Try to reproduce the error using a load test tool. I use jmeter. Lots of people don't know that they have this issue, because they have too little traffic.