类型或命名空间名称'对象'不命名空间中存在'System.Data这'空间、对象、名称、存在

2023-09-04 01:33:42 作者:甜甜的少女心

我使用的实体,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.

 
精彩推荐
图片推荐