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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s