The type or namespace name 'Objects' does not exist in the namespace 'System.Data'

Viewed 111829

I am using entities, C# and SQL Server to create an n-tier app. I am creating some base classes common to all my DAL components. In this base class, i want to handle the connection state of the ObjectContext base class inherited by entities object.

Compiling throws the following error:

The type or namespace name 'Objects' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)

Also, the using statement System.Data.Objects doesn't resolve for the same reason.

I tried adding the assembly as reference, but couldn't find it in the .NET tab of assembly references.

Any thoughts? Thanks!

9 Answers

For EF6, replace "xxxx.Context.cs" with these using

using System;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Data.Entity.Core.Objects;
using System.Linq;
Related