类型或命名空间名称'对象'不命名空间中存在'System.Data这' [英] The type or namespace name 'Objects' does not exist in the namespace 'System.Data'

查看:239
本文介绍了类型或命名空间名称'对象'不命名空间中存在'System.Data这'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的实体,C#和SQL Server创建一个n层应用程序。我创造了一些适用于所有我DAL组件的基类。在这个基类,我要处理的ObjectContext的基类继承的实体连接状态对象。

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.

编译引发以下错误:

中的类型或命名空间名称对象   在命名空间中不存在   System.Data这'(是缺少程序   集引用?)

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

此外,using语句System.Data.Objects不能解决出于同样的原因。

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

我尝试添加该组件作为参考,但无法找到它的程序集引用.NET选项卡。

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

有什么想法?谢谢!

推荐答案

您需要添加一个引用到.NET程序集System.Data.Entity.dll。

You need to add a reference to the .NET assembly System.Data.Entity.dll.

这篇关于类型或命名空间名称'对象'不命名空间中存在'System.Data这'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆