I'm trying to use my 'context' object in a using statement. It works on one project, but on another, I'm getting the following error.
'...': type used in a using statement must be implicitly convertible to 'System.IDisposable'
When I'm referring to the 'context' object, I'm referring to the object automatically created when you're working with LINQ to SQL.
The class I'm working within, implements another interface, could that be screwing up this context object?
using (TGDC context = new TGDC())
{
}
the word
using
has the red squigly line under it (error).
You should add a reference to System.Data.Linq
. I suspect that's the issue.
Or, if you are using Entity Framework, make sure you have a reference to System.Data.Entity
and System.Data.Objects
(C#: using
/ VB.NET: Imports
).
Add a reference to the EntityFramework.dll assembly that is referenced by the project that defines your EF context class.
Add a reference to the EntityFramework assembly
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With