VS2008 Entity Framework The ObjectContext instance has been disposed and can no longer be used for operations that require a connection
I am using entity framework with VS 2008. I am getting error "The ObjectContext instance has been disposed and can no longer be used for operations that require a connection."
This c开发者_StackOverflowan be avoided by setting LazyLoadingEnable=false but it is supported by EF4 and .Net framework 4 vs2010
Is there any alternative for vs2008 to remove this error?
if your queries against the objectcontext have a return type of IQueryable or IEnumerable, the data is not retrieved from the database until you enumerate it.
you will receive that error if you try to enumerate later, when the objectcontext is already disposed.
also have a look here: ASP.Net Entity Framework, objectcontext error
精彩评论