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 u
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).
It says that TGDC does not implement the IDisposable interface.
How does the class declaration for TGDC look? Do you have more compiler errors? Do you have several classes named TGDC in different namespaces?
Add a reference to the EntityFramework assembly
Add a reference to the EntityFramework.dll assembly that is referenced by the project that defines your EF context class.
You should add a reference to System.Data.Linq. I suspect that's the issue.
I get this periodically and for a while I always used to struggle with it because its not immediately evident what's wrong. Seems like all the hoops have been jumped through, but alas, not so. Eventually the solution will stick.
In the project you are writing this code you are referencing the project in which your "TGDC" is defined but you are not referencing System.Data.Linq. You need to reference both these assemblies. This can only really happen when you are using some sort of a layered architecture.