Wednesday, August 7, 2013

‘MyEntities’: type used in a using statement must be implicitly convertible to ‘System.IDisposable’

‘MyEntities’: type used in a using statement must be implicitly convertible to ‘System.IDisposable’

When trying to access the entity object which is in a different project, I added the reference of the project having the entity object to the new project and was trying to use the code block as below:

 using (Entities entities = new Entities(entityConnStr))
{

}

This gave me the error. The solution for this was to add a reference to 'System.Data.Entity' in the new project. After this it started working for me.


No comments:

Post a Comment