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

If you are using “using” statements to manage your data contexts in Linq to SQL (I’m not sure if this applies to Linq to Entity but I imagine it does”) and you get the following error:

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

Simply add a reference to the “System.Data.Linq” assembly and it solves the problem.

idisposableerror1

Hope this helps someone.

Happy coding,

Tom Hundley
Elegant Software Solutions

What are your thoughts?

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.