类型或命名空间名称DataSetExtensions“没有命名空间存在'System.Data这'(是否缺少程序集引用?) [英] The type or namespace name 'DataSetExtensions' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)

查看:1758
本文介绍了类型或命名空间名称DataSetExtensions“没有命名空间存在'System.Data这'(是否缺少程序集引用?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这是一个常见的​​错误,但我有正确的参考System.Data.DataSetExtensions.dll添加到项目中,我的项目是专为.NET 4.5的SQL CLR项目,我得到的错误下面一行:

I know this is a common error but I have the correct reference to the System.Data.DataSetExtensions.dll added to the project and my project is a SQL CLR project built for .net 4.5 and I'm getting the error at the following line:

using System.Data.DataSetExtensions;

我还检查了属性的DLL和它引用的正确版本为4.5的dll那么还有什么能可能会造成这个问题?这是一个问题与SQL CLR项目?

I also checked the properties for the dll and it is referencing the correct version for the 4.5 dll so what else could possibly be causing this issue? Is this an issue with SQL CLR projects?

推荐答案

System.Data.DataSetExtensions 是一个汇编,而不是一个命名空间。你只需要添加的引用 System.Data.DataSetExtensions.dll (因为你说你已经有),然后用指令为 System.Data这命名空间:

System.Data.DataSetExtensions is an assembly, not a namespace. You just need to add a reference to System.Data.DataSetExtensions.dll (as you say you already have) and then a using directive for the System.Data namespace:

using System.Data;

这将在类的所有扩展方法在该命名空间,如拉<一href="https://msdn.microsoft.com/en-us/library/system.data.datarowextensions"><$c$c>DataRowExtensions.

That will pull in all the extension methods in the classes in that namespace, e.g. DataRowExtensions.

当你要找的文件,总是小心的命名空间和程序集名称之间的区别 - 他们往往是相同的,但它们在逻辑上独立的

When you're looking in documentation, always be careful about the difference between namespaces and assembly names - they're often the same, but they're logically independent.

这篇关于类型或命名空间名称DataSetExtensions“没有命名空间存在'System.Data这'(是否缺少程序集引用?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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